Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109161 胡海峰老师 18高度为k的树 C++ Accepted 6 MS 4176 KB 315 2025-02-05 12:54:17

Tests(10/10):


Code:

#include <iostream> using namespace std; int main () { int a[1000008]={}; int n,k; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } cin>>k; int tot =0; for(int i=1;i<=n;i++) if( k == a[i]) tot ++; cout<<tot; return 0; } /* Input 5 3 4 5 2 3 3 Output 2 */