結果

問題 No.24 数当てゲーム
ユーザー mondomondo
提出日時 2019-07-26 15:17:28
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 12,088 KB
実行使用メモリ 12,336 KB
最終ジャッジ日時 2023-09-15 00:20:41
合計ジャッジ時間 942 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 8 ms
12,204 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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++){
    $line = explode(" ", trim(fgets(STDIN)));
    if ($line[4] == 'YES') {
        unset($line[4]);
        for ($j=0; $j<10; $j++){
            if (in_array($j, $line)) continue;
            $a[$j] = false;
            }
        } else {
            for ($j=0; $j<4; $j++) {
                $a[$line[$j]] = false;
            }
        }
    }
for ($j=0; $j<10; $j++){
    if (!$a[$j]) continue;
    echo $i;
    break;
}
0