結果

問題 No.24 数当てゲーム
ユーザー MizunoMizuno
提出日時 2024-09-14 14:08:31
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 32,272 KB
実行使用メモリ 32,660 KB
最終ジャッジ日時 2024-09-14 14:08:37
合計ジャッジ時間 1,733 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
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
// Your code here!
$p = trim(fgets(STDIN));

for($i = 0; $i < $p; $i++) {
    $array[] = explode(" ",trim(fgets(STDIN)));
}

print_r($array);

$num = range(0,9);

$flag = false;

for($i = 0; $i < $p; $i++) {
    if($array[$i][4] == "NO") {
        $num = array_diff($num, $array[$i]);
    } else {
        if($flag) {
            $val = [];
            for($j = 0; $j < 4; $j++) {
                if(in_array($array[$i][$j],$num)) {
                    $val[] = $array[$i][$j];
                }
            }
            $num = $val;
        } else {
            $num = array($array[$i][0],$array[$i][1],$array[$i][2],$array[$i][3]);
            $flag = true;
        }
    }
}
$result = array_values($num);

echo $result[0];
?>
0