結果

問題 No.24 数当てゲーム
ユーザー ゴリポン先生ゴリポン先生
提出日時 2024-02-05 22:37:41
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 433 bytes
コンパイル時間 3,944 ms
コンパイル使用メモリ 203,608 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-05 22:37:46
合計ジャッジ時間 4,677 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

module main;

import std;

void main()
{
	int N = readln.chomp.to!int;
	BitArray bit = true.repeat(10).array;
	foreach (_; 0 .. N) {
		int A, B, C, D;
		string R;
		readln.chomp.formattedRead("%d %d %d %d %s", A, B, C, D, R);
		if (R == "YES") {
			BitArray b = false.repeat(10).array;
			b[A] = b[B] = b[C] = b[D] = true;
			bit &= b;
		}
		else {
			bit[A] = bit[B] = bit[C] = bit[D] = false;
		}
	}
	writeln(bit.bitsSet.front);
}
0