結果

問題 No.24 数当てゲーム
ユーザー Zu_rinZu_rin
提出日時 2019-04-01 22:10:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 74,840 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-05 08:02:40
合計ジャッジ時間 1,185 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	int num, i = 0, j, k;
	cin >> num;
	string s;
	vector<int> ans(10, 1), qs(5, 16);
	for (; i < num; i++) {
		scanf("%d%d%d%d", &qs[0], &qs[1], &qs[2], &qs[3]);
		cin >> s;
		sort(qs.begin(), qs.end());
		if (s == "YES") {
			for (j = 0, k = 0; j < 10; j++) {
				if (ans[j] == 2)
					continue;
				if (j == qs[k]) 
					k++;
				else
					ans[j] = 2;
			}
		}
		else {
			for (j = 0; j < 4; j++)
				ans[qs[j]] = 2;
		}
	}
	for (i = 0; i < 10; i++) {
		if (ans[i] == 1)
			cout << i << "\n";
	}
	return 0;
}
0