結果

問題 No.24 数当てゲーム
ユーザー siguma323siguma323
提出日時 2016-05-08 16:47:15
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 957 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 89,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 13:52:12
合計ジャッジ時間 1,295 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <iterator>
#include <cmath>
#include <iomanip>
using namespace std;

using ull = unsigned long long;
using ll = long long;

int main()
{
    int n;
    cin >> n;

    set<int> ans = {0,1,2,3,4,5,6,7,8,9};

    for(int i = 0; i < n; ++i)
    {
        int a,b,c,d;
        cin >> a >> b >> c >> d;
        string res;
        cin >> res;

        if(res == "YES")
        {
            for(int i =0; i < 10; ++i)
            {
                if(a == i || b == i || c == i || d == i)    continue;
                ans.erase(i);
            }
        }
        else
        {
            ans.erase(a);
            ans.erase(b);
            ans.erase(c);
            ans.erase(d);
        }
    }

    cout << *(ans.begin()) << endl;
}
0