結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2020-11-22 20:28:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 2,058 ms |
| コンパイル使用メモリ | 197,884 KB |
| 最終ジャッジ日時 | 2025-01-16 04:38:05 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 3 |
| other | RE * 8 TLE * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ‘n’ is used uninitialized [-Wuninitialized]
6 | int L[n];
| ^
main.cpp:5:7: note: ‘n’ declared here
5 | int n;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
int L[n];
cin>>n;
map<int,int>mp;
for(int i=0;i<n;i++){
cin>>L[i];
mp[L[i]]++;
}
int ans=0;
int nummax=0;
for(auto itr=mp.begin();itr != mp.end();itr++){
//cout<<itr->first<<" "<<itr->second<<endl;
if((itr->second)>=nummax){
nummax=itr->second;
ans=(itr->first);
}
}
cout<<ans<<endl;
return 0;
}
chacoder1