結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2016-06-15 01:17:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 355 bytes |
| コンパイル時間 | 505 ms |
| コンパイル使用メモリ | 67,428 KB |
| 最終ジャッジ日時 | 2024-11-14 19:45:23 |
| 合計ジャッジ時間 | 919 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:15:5: error: 'vector' was not declared in this scope
15 | vector<pair<int, int>> a;
| ^~~~~~
main.cpp:4:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
3 | #include <map>
+++ |+#include <vector>
4 | using namespace std;
main.cpp:15:25: error: expected primary-expression before '>' token
15 | vector<pair<int, int>> a;
| ^~
main.cpp:15:28: error: 'a' was not declared in this scope
15 | vector<pair<int, int>> a;
| ^
ソースコード
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
int n; cin>>n;
map<int, int> m;
for(int i=0; i<n; ++i) {
int l; cin>>l;
m[l]++;
}
vector<pair<int, int>> a;
for(auto& e: m) a.emplace_back(e.second, e.first);
sort(begin(a), end(a));
cout<<a.back().second<<endl;
}
hogeover30