Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
106099 | 冯俊淞 | 19选班长 | C++ | Time Limit Exceeded | 1000 MS | 264 KB | 299 | 2025-01-15 13:28:19 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n+1]; for(int i=1;i<=n;i++){ a[i]=0; } for(int i=0;i<n;i++){ int b; cin>>b; a[b]++; } int max=1; for(int i=1;i<=n;i++){ if(a[i]>a[max]){ i=max; } } cout<<max; return 0; }