結果

問題 No.24 数当てゲーム
ユーザー zenito9970
提出日時 2016-11-03 00:16:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,577 ms
コンパイル使用メモリ 171,356 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 01:46:00
合計ジャッジ時間 1,944 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n; cin >> n;
    vector<bool> is(11, true);
    vector<int> cnt(11, 0);
    rep(i, n) {
        int a, b, c, d; cin >> a >> b >> c >> d;
        string r; cin >> r;
        if(r == "NO") {
            is[a] = is[b] = is[c] = is[d] = false;
        } else {
            cnt[a]++;
            cnt[b]++;
            cnt[c]++;
            cnt[d]++;
        }
    }
    int ans = 0, acnt = -1;
    for(int i = 1; i <= 10; ++i) {
        if(is[i] && acnt < cnt[i]) {
            ans = i;
            acnt = cnt[i];
        }
    }
    cout << ans << endl;
    return 0;
}
0