結果

問題 No.706 多眼生物の調査
ユーザー ajinoriajinori
提出日時 2018-06-29 22:28:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 1,076 bytes
コンパイル時間 1,530 ms
コンパイル使用メモリ 164,924 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 15:21:25
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 5 ms
4,380 KB
testcase_06 AC 11 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
//    ifstream in("input.txt");
//    cin.rdbuf(in.rdbuf());
    int n;
    cin >> n;
    int a[100100] = {};
    rep(i,n){
        string s;
        cin >> s;
        a[s.size()-2]++;
    }
    int ma = 0;
    int ans = 0;
    rep(i,1001){
        if(ma <= a[i]){
            ma = a[i];
            ans = i;
        }
    }
    cout << ans << endl;
    return 0;
}
0