結果

問題 No.24 数当てゲーム
ユーザー anonymouslyanonymously
提出日時 2023-12-12 09:23:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 646 bytes
コンパイル時間 3,477 ms
コンパイル使用メモリ 175,076 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-12 09:24:03
合計ジャッジ時間 2,692 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	set<int> WA; //候補でなくなった数字
	while(N--){
		int a,b,c,d;
		string r;
		cin >> a >> b >> c >> d >> r;
		if(r=="YES"){//無い数字をWAに挿入する
			set<int> AC; //候補の数字
			AC.insert(a);
			AC.insert(b);
			AC.insert(c);
			AC.insert(d);
			for(int i=0;i<10;i++){
				if(!AC.count(i)){
					WA.insert(i);
				}
			}
		}else if(r=="NO"){//有る数字をWAに挿入する
			WA.insert(a);
			WA.insert(b);
			WA.insert(c);
			WA.insert(d);
		}
	}
		
	for(int i=0;i<10;i++){
		if(!WA.count(i)){
			cout << i << endl;
		}
	}

	return 0;
}
0