結果

問題 No.706 多眼生物の調査
ユーザー ngtkanangtkana
提出日時 2020-02-27 12:52:33
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 1,500 ms
コンパイル使用メモリ 166,644 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-03 18:45:55
合計ジャッジ時間 2,148 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 5 ms
4,376 KB
testcase_06 AC 10 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
int main(){
    int n;std::cin>>n;
    std::vector<int>a(1001);
    for(int i=0;i<n;i++){
        std::string s;std::cin>>s;
        a.at(s.length())++;
    }
    int ans=0;
    int max=0;
    for(int i=0;i<=1000;i++){
        if(max<=a.at(i)){
            max=a.at(i);
            ans=i-2;
        }
    }
    std::cout<<ans<<std::endl;
}

0