Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140764 令狐文丽 19选班长 C++ Accepted 1 MS 272 KB 358 2025-12-20 12:43:25

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int b[11]={0}; int n,a,max=0,index;//index 最大值的数对应的下标 cin>>n; for(int i=1;i<=3*n;i++){ cin>>a; b[a]++; } for(int i = 1;i<=n;i++){ if(b[i]>max){ max=b[i];//更新max的内容 index=i; } } cout<<index; return 0; }