結果

問題 No.24 数当てゲーム
ユーザー zenito9970zenito9970
提出日時 2016-11-03 00:16:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 169,036 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-16 12:51:41
合計ジャッジ時間 2,229 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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