Submission #00103


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
map<int,int> x;
for(int i=0;i<n;i++){
cin>>a[i];
x[a[i]]++;
}
int MAX=0;
for(auto itr=x.begin(); itr!=x.end();itr++){
MAX=max(MAX,itr->second);
}
for(auto itr=x.begin(); itr!=x.end();itr++){
if(MAX==itr->second){
cout<<itr->first<<"\n";
}
}
}
// cout<<itr->first<<" ";

ステータス

項目 データ
問題 0011 - 強欲な壺
ユーザー名 r2306
投稿日時 2023-11-13 18:21:54
言語 C++17
状態 Accepted
得点 50
ソースコード長 486 Byte
最大実行時間 117 ms
最大メモリ使用量 5748 KB

セット

セット 得点 Cases
1 ALL 50 / 50 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in-01.txt AC 23 ms 476 KB
1
in-02.txt AC 30 ms 700 KB
1
in-03.txt AC 21 ms 540 KB
1
in-04.txt AC 21 ms 380 KB
1
in-05.txt AC 84 ms 5476 KB
1
in-06.txt AC 40 ms 2168 KB
1
in-07.txt AC 117 ms 5704 KB
1
in-08.txt AC 27 ms 1208 KB
1
in-09.txt AC 60 ms 3996 KB
1
in-10.txt AC 85 ms 5748 KB
1