Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
20241 | 董承诺 | 哪种苹果最多 | C++ | Accepted | 100 | 0 MS | 256 KB | 284 | 2021-06-06 15:07:44 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,d[1001]={0},di,maxn=0,maxdi=0; cin>>n; for(int i=1;i<=n;i++){ cin>>di; d[di]++; } for(int i=1;i<=1000;i++){ if(d[i]>maxn){ maxn=d[i]; maxdi=i; } } cout<<maxdi<<" "<<maxn; return 0; }