結果

問題 No.293 4>7の世界
ユーザー benben
提出日時 2015-11-19 20:49:46
言語 PHP
(8.3.4)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 587 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 18,816 KB
実行使用メモリ 19,140 KB
最終ジャッジ日時 2023-10-11 18:06:19
合計ジャッジ時間 1,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
19,048 KB
testcase_01 AC 15 ms
19,052 KB
testcase_02 AC 16 ms
19,000 KB
testcase_03 WA -
testcase_04 AC 14 ms
19,032 KB
testcase_05 AC 16 ms
18,940 KB
testcase_06 AC 16 ms
19,028 KB
testcase_07 AC 16 ms
18,892 KB
testcase_08 AC 15 ms
19,016 KB
testcase_09 WA -
testcase_10 AC 14 ms
18,964 KB
testcase_11 AC 15 ms
19,032 KB
testcase_12 AC 15 ms
18,824 KB
testcase_13 AC 16 ms
18,960 KB
testcase_14 AC 15 ms
18,904 KB
testcase_15 AC 15 ms
19,004 KB
testcase_16 AC 15 ms
19,000 KB
testcase_17 AC 15 ms
18,808 KB
testcase_18 AC 15 ms
18,948 KB
testcase_19 AC 15 ms
19,008 KB
testcase_20 AC 15 ms
19,072 KB
testcase_21 AC 15 ms
18,940 KB
testcase_22 AC 15 ms
19,056 KB
testcase_23 AC 15 ms
18,932 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
fscanf(STDIN, "%d %d", $b, $c);

$tmp_b = $b;
$tmp_c = $c;
if (preg_match("/4|7/", $b) && preg_match("/4|7/", $c) && checkdata($b,$c)){
    $list = array("4"=>"7", "7"=>"4");
    $tmp_b = strtr($b, $list);
    $tmp_c = strtr($c, $list);
}



if($tmp_b < $tmp_c) echo $c;
if($tmp_c < $tmp_b) echo $b;

echo "\n";


function checkdata($b,$c){
    if(strstr($b,"4") && strstr($c,"4")){
        if(!strstr($b,"7") && !strstr($c,"7")) return false;
    }
    if(strstr($b,"7") && strstr($c,"7")){
        if(!strstr($b,"4") && !strstr($c,"4")) return false;
    }
    return true;
}
?>
0