Submission #00097
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; vector< int > a(n); map< int , int >m; for ( int i=0;i<n;i++){ cin>>a[i]; } sort(a.begin(),a.end()); for ( int i=0;i<n;i++){ m[a[i]]++; } int ma=0; for (auto itr = m.begin(); itr != m.end(); itr++) { if (ma<itr->second){ ma=itr->second; } } for (auto itr = m.begin(); itr != m.end(); itr++) { if (ma==itr->second){ cout<<itr->first<< "\n" ; } } } |
ステータス
項目 | データ |
---|---|
問題 | 0011 - 強欲な壺 |
ユーザー名 | ei2331 |
投稿日時 | 2023-11-13 18:03:37 |
言語 | C++17 |
状態 | Accepted |
得点 | 50 |
ソースコード長 | 553 Byte |
最大実行時間 | 68 ms |
最大メモリ使用量 | 5832 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 50 / 50 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in-01.txt | AC | 25 ms | 600 KB |
1
|
in-02.txt | AC | 19 ms | 444 KB |
1
|
in-03.txt | AC | 22 ms | 548 KB |
1
|
in-04.txt | AC | 23 ms | 516 KB |
1
|
in-05.txt | AC | 67 ms | 5608 KB |
1
|
in-06.txt | AC | 34 ms | 2164 KB |
1
|
in-07.txt | AC | 63 ms | 5820 KB |
1
|
in-08.txt | AC | 19 ms | 1188 KB |
1
|
in-09.txt | AC | 62 ms | 4092 KB |
1
|
in-10.txt | AC | 68 ms | 5832 KB |
1
|