結果

問題 No.706 多眼生物の調査
ユーザー nukachanukacha
提出日時 2018-07-24 19:33:32
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 83,776 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 10:54:09
合計ジャッジ時間 1,030 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

int N;
string S[1000];
int lens[1000];

int main() {
    cin >> N;
    int max_freq = 0;
    int result_len = 0;
    for (int i = 0; i < N; i++) {
        cin >> S[i];
    }
    for (int i = 0; i < N; i++) {
        lens[S[i].length() - 2] += 1;
    }
    for (int i = 0; i < 1000; i++) {
        if (max_freq <= lens[i]) {
            result_len = i;
            max_freq = lens[i];
        }
    }
    cout << result_len << endl;
}
0