結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー hadrori
提出日時 2015-07-26 17:21:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 8 ms / 5,000 ms
コード長 555 bytes
コンパイル時間 1,341 ms
コンパイル使用メモリ 159,332 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 07:38:03
合計ジャッジ時間 2,266 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int n, a[100010], cnt[8];

int solve() {
    rep(i,n) cnt[a[i]]++;
    int x = 0, y = 0;
    rep(i,7) {
        if(x <= cnt[i]) {
            x = cnt[i];
            y = i;
        }
    }
    return y;
}

void input() {
    cin >> n;
    rep(i,n) cin >> a[i];
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cout << fixed << setprecision(12);
    input();
    cout << solve() << endl;
    return 0;
}
0