結果

問題 No.24 数当てゲーム
ユーザー rabimea
提出日時 2025-09-27 05:35:43
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 767 bytes
コンパイル時間 2,759 ms
コンパイル使用メモリ 279,280 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-27 05:35:47
合計ジャッジ時間 3,742 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target ("avx,avx2,fma")
#include <bits/stdc++.h>

using std::cin, std::cout, std::cerr;
using ll = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::vector<bool> v(10, true);
    int n; cin >> n;
    while(n --) {
        int a[4];
        std::string s;
        for(int i = 0; i < 4; i ++)
            cin >> a[i];
        cin >> s;
        if(s == "YES") {
            for(int i = 0; i < 10; i ++)
                if(std::count(a, a + 4, i) == 0)
                    v[i] = false;
        } else {
            for(int x : a)
                v[x] = false;
        }
    }
    for(int i = 0; i < 10; i ++)
        if(v[i])
            cout << i << '\n';
}
0