結果

問題 No.24 数当てゲーム
ユーザー dnishdnish
提出日時 2016-12-30 21:15:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 416 bytes
コンパイル時間 1,797 ms
コンパイル使用メモリ 171,900 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-22 08:35:26
合計ジャッジ時間 2,627 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main() {

	int N;
	set<int> st{0,1,2,3,4,5,6,7,8,9};
	cin>>N;
	int A,B,C,D;
	string R;
	for(int i=0;i<N;i++){
		cin>>A>>B>>C>>D>>R;
		if(R=="YES"){
			for(int j=0;j<10;j++){
				if(j != A && j!= B && j != C && j!= D){
					st.erase(j);
				}
			}
		}else{
			st.erase(A);
			st.erase(B);
			st.erase(C);
			st.erase(D);
		}
	}
	cout<<*st.begin()<<endl;
	return 0;
}
0