結果

問題 No.706 多眼生物の調査
コンテスト
ユーザー troro_kelp
提出日時 2019-03-10 20:14:54
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,057 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 582 ms
コンパイル使用メモリ 112,280 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 12:04:23
合計ジャッジ時間 985 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59
using ld = long double;

bool operator<(const pair<int, int> &a, const pair<int, int> &b)
{
    if (a.first == b.first)
    {
        return b.second > a.second;
    }
    return a.first < b.first;
}

int a[1010];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(6);

    int n;
    cin >> n;

    for (int i = 0; i < n; ++i)
    {
        string s;
        cin >> s;
        a[(int)s.size() - 2]++;
    }

    int maxV = 0;
    int ans = 0;
    for (int i = 0; i < 1010; ++i)
    {
        if (maxV <= a[i])
        {
            maxV = a[i];
            ans = i;
        }
    }
    cout << ans << endl;

    return 0;
}
0