結果

問題 No.706 多眼生物の調査
ユーザー donkorin_donkorin_
提出日時 2018-07-09 10:14:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 892 bytes
コンパイル時間 1,290 ms
コンパイル使用メモリ 144,380 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 08:32:56
合計ジャッジ時間 1,734 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF 1e18
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int used[10000];
int n;
string s;
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> n;
    rep(i, 0, n) {
        string s;
        cin >> s;
        used[s.size()-2]++;
    }
    int ans_val = 0, itr = 0;
    rep(i, 1, 1005) {
        if (used[i] >= ans_val) {
            ans_val = used[i];
            itr = i;
        }
    }
    cout << itr << endl;
    return 0;
}
0