結果

問題 No.24 数当てゲーム
ユーザー hotpepsihotpepsi
提出日時 2015-03-22 01:31:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 716 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 67,080 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 09:20:16
合計ジャッジ時間 1,220 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <set>
#include <vector>

using namespace std;
const int MOD = 1000003;

int main(int argc, char *argv[]) {
	string s;
	getline(cin, s);
	int N = atoi(s.c_str());
	int p[10] = {};
	for (int i = 0; i < N; ++i) {
		getline(cin, s);
		stringstream ss(s);
		int a, b, c, d;
		string r;
		ss >> a >> b >> c >> d >> r;
		if (r.compare("YES") == 0) {
			for (int j = 0; j < 10; ++j) {
				if (j != a && j != b && j != c && j != d) {
					p[j] = 1;
				}
			}
		} else {
			p[a] = p[b] = p[c] = p[d] = 1;
		}
	}
	int ans = 0;
	for (int j = 0; j < 10; ++j) {
		if (!p[j]) {
			ans = j;
			break;
		}
	}
	cout << ans << endl;
	return 0;
}
0