結果
| 問題 |
No.706 多眼生物の調査
|
| コンテスト | |
| ユーザー |
👑 tatyam
|
| 提出日時 | 2018-06-29 22:44:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 1,231 ms |
| コンパイル使用メモリ | 161,296 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 00:04:49 |
| 合計ジャッジ時間 | 1,754 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:11: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
20 | cout<<ans;
| ^~~
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(int i=(l);i<(r);i++)
#define fcout cout << fixed << setprecision(10)
int main(){
int n;
vector<int>a(1000);
cin>>n;
string s;
rep(i,0,n){
cin>>s;
a.at(s.size()-2)++;
}
int mx=0,ans;
rep(i,0,1000)if(a.at(i)>=mx){
mx=a.at(i);
ans=i;
}
cout<<ans;
}
tatyam