結果

問題 No.24 数当てゲーム
ユーザー papinianuspapinianus
提出日時 2016-06-01 10:32:22
言語 PHP
(8.3.4)
結果
AC  
実行時間 65 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 30,824 KB
実行使用メモリ 31,048 KB
最終ジャッジ日時 2024-04-16 22:22:04
合計ジャッジ時間 1,541 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
31,036 KB
testcase_01 AC 65 ms
31,040 KB
testcase_02 AC 41 ms
30,828 KB
testcase_03 AC 41 ms
31,040 KB
testcase_04 AC 41 ms
30,864 KB
testcase_05 AC 41 ms
30,992 KB
testcase_06 AC 41 ms
30,748 KB
testcase_07 AC 41 ms
31,048 KB
testcase_08 AC 40 ms
30,924 KB
testcase_09 AC 41 ms
30,900 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$base = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,];
$count = trim(fgets(STDIN));
for($i = 0; $i < $count ; $i++) {
    $nums = explode(' ', trim(fgets(STDIN)));
    $y_or_n = array_pop($nums);
    if($y_or_n == 'YES') {
        $base = array_intersect($base, $nums);
    } else if ($y_or_n == 'NO') {
        $base = array_diff($base, $nums);
    }
}
foreach($base as $val) {
    echo $val.PHP_EOL;
}
0