結果

問題 No.24 数当てゲーム
ユーザー ねずねず
提出日時 2018-01-27 23:43:16
言語 PHP
(8.2.11)
結果
AC  
実行時間 8 ms / 5,000 ms
コード長 424 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 12,052 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2023-08-28 10:05:00
合計ジャッジ時間 900 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
12,288 KB
testcase_01 AC 8 ms
12,272 KB
testcase_02 AC 8 ms
12,232 KB
testcase_03 AC 7 ms
12,288 KB
testcase_04 AC 7 ms
12,240 KB
testcase_05 AC 7 ms
12,248 KB
testcase_06 AC 8 ms
12,184 KB
testcase_07 AC 7 ms
12,244 KB
testcase_08 AC 7 ms
12,200 KB
testcase_09 AC 7 ms
12,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$a = array_fill(0, 10, true);
for ($i = 0; $i < $n; $i++) {
	$hint = explode(" ", trim(fgets(STDIN)));
	if ($hint[4] == 'YES') {
		unset($hint[4]);
		for ($j = 0; $j < 10; $j++) {
			if (in_array($j, $hint)) continue;
			$a[$j] = false;
		}
	} else {
		for ($j = 0; $j < 4; $j++) {
			$a[$hint[$j]] = false;
		}
	}
}
for ($i = 0; $i < 10; $i++) {
	if (!$a[$i]) continue;
	echo $i;
	break;
}
?>
0