結果

問題 No.706 多眼生物の調査
ユーザー kyawashell
提出日時 2018-06-29 22:24:53
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 980 ms
コンパイル使用メモリ 66,828 KB
最終ジャッジ日時 2025-01-06 11:40:44
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

typedef long long ll;

ll n;
string s[1010];

ll cou[1010];

int main() {
    cin >> n;
    rep(i,n)cin >> s[i];

    rep(i,n) {
        ll sum = 0;
        for(auto c : s[i]) {
            if(c == '^')sum++;
        }
        cou[sum]++;
    }

    ll ans = 0;
    rep(i,1001) {
        if(cou[ans] <= cou[i])ans = i;
    }
    cout << ans << endl;
}
0