結果

問題 No.24 数当てゲーム
コンテスト
ユーザー scrive66
提出日時 2015-06-01 21:19:30
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 897µs
コード長 898 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 606 ms
コンパイル使用メモリ 103,208 KB
実行使用メモリ 9,868 KB
最終ジャッジ日時 2026-11-15 14:12:06
合計ジャッジ時間 2,045 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    unordered_set<int> remain{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

    for (int i = 0; i < n; ++i) {
        vector<int> a(4);
        string s;
        cin >> a[0] >> a[1] >> a[2] >> a[3] >> s;
        if (s == "YES") {
            vector<int> vector1;
            for (auto x:a) {
                if (remain.find(x) != remain.end()) {
                    vector1.push_back(x);
                }
            }
            remain.clear();
            for (auto x:vector1) {
                remain.insert(x);
            }
        } else {
            for (auto x:a) {
                remain.erase(x);
            }
        }
    }

    for (auto x:remain) {
        cout << x << endl;
    }

    return 0;
}
0