結果

問題 No.706 多眼生物の調査
ユーザー take000take000
提出日時 2021-09-04 20:38:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 3,460 ms
コンパイル使用メモリ 205,096 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-23 11:59:08
合計ジャッジ時間 3,241 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
using namespace std;

int main() {
    int N;
    cin >> N;

    map<int, int> mp;
    rep(i, N) {
        string s;
        cin >> s;
        mp[int(s.size()) - 2]++;
    }

    int ans = 0;
    int ma = 0;
    for (auto p : mp) {
        if (p.second >= ma) {
            ma = p.second;
            ans = p.first;
        }
    }

    cout << ans << endl;

    return 0;
}
0