結果

問題 No.706 多眼生物の調査
ユーザー kikage
提出日時 2020-04-02 02:19:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 54,748 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 14:35:03
合計ジャッジ時間 1,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int N,key=0,cnt[1000+1]={0};
    cin >> N;
    string s;
    for(int i=0;i<N;i++){
        cin >> s;
        int p=s.size()-2;
        cnt[p]++;
        if(cnt[key]<cnt[p])key=p;
        else if(cnt[key]==cnt[p])key=max(key,p);
    }
    cout << key << endl;
    return 0;
}
0