結果

問題 No.24 数当てゲーム
ユーザー anonymously
提出日時 2023-12-12 09:23:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 646 bytes
コンパイル時間 1,674 ms
コンパイル使用メモリ 175,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-27 04:52:08
合計ジャッジ時間 2,311 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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