結果

問題 No.24 数当てゲーム
ユーザー oga00826oga00826
提出日時 2019-05-16 14:00:12
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 3,647 ms
コンパイル使用メモリ 32,496 KB
実行使用メモリ 32,680 KB
最終ジャッジ日時 2023-10-17 06:52:42
合計ジャッジ時間 4,680 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

$turn = fgets(STDIN);
$hairetsu = [];


$all_ans = [0,1,2,3,4,5,6,7,8,9]; 
$all_del = [];

for ($i=0; $i<$turn; $i++) {
    
    $hairetsu[] = explode(" ", trim(fgets(STDIN)));
    
    $result = array_slice($hairetsu[$i] , 4, 1);
    
    if($result[0] == "NO"){
        $add_del = array_slice($hairetsu[$i] , 0, 4);
        $all_del = array_merge($all_del, $add_del);
    }
    
}

$unique = array_unique($all_del);

foreach($unique as $u){
    //削除実行
    if(($key = array_search($u, $all_ans)) !== false) {
        unset($all_ans[$key]);
    } 
}
$val = array_values($all_ans);
echo $val[0]."\n";
0