結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー byami
提出日時 2017-11-04 21:44:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 1,475 ms
コンパイル使用メモリ 167,052 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-24 01:14:56
合計ジャッジ時間 2,365 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n; cin >> n;
    vector<int> num(7);
    rep(i,0,n){
        int temp;
        cin >> temp;
        num[temp]++;
    }
    int ans = -1;
    int cnt = -1;
    per(i,7-1,0){
        if(cnt < num[i]){
            cnt = num[i];
            ans = i;
        }
    }
    cout << ans << endl;
}
0