結果

問題 No.632 穴埋め門松列
ユーザー mondomondo
提出日時 2019-08-13 15:17:33
言語 PHP
(8.3.4)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 615 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 32,688 KB
実行使用メモリ 32,956 KB
最終ジャッジ日時 2023-10-19 17:07:32
合計ジャッジ時間 937 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$line = explode(" ", trim(fgets(STDIN)));
$i = array_search("?", $line);
$line[$i] = 4;
if ($line[0] < $line[1] && $line[1] > $line[2]
     && count(array_unique($line)) == 3) {
    $cnt++;
    $ans = 4;
}
if ($line[0] > $line[1] && $line[1] < $line[2]
    && count(array_count_values($line)) == 3) {
    $cnt++;
    $ans = 4;
}
$line[$i] = 1;
if ($line[0] < $line[1] && $line[1] > $line[2]
     && count(array_unique($line)) == 3) {
    $cnt++;
    $ans = 1;
}
if ($line[0] > $line[1] && $line[1] < $line[2]
     && count(array_unique($line)) == 3) {
    $cnt++;
    $ans = 1;
}
echo $cnt == 1 ? $ans : "14";
0