結果

問題 No.441 和か積
ユーザー papinianuspapinianus
提出日時 2016-11-14 13:01:59
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 2,954 ms
コンパイル使用メモリ 30,500 KB
実行使用メモリ 31,208 KB
最終ジャッジ日時 2024-05-04 11:41:06
合計ジャッジ時間 5,472 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
31,088 KB
testcase_01 AC 40 ms
31,108 KB
testcase_02 AC 40 ms
31,068 KB
testcase_03 AC 40 ms
31,004 KB
testcase_04 AC 40 ms
30,884 KB
testcase_05 AC 39 ms
31,124 KB
testcase_06 AC 42 ms
31,020 KB
testcase_07 AC 41 ms
31,004 KB
testcase_08 AC 40 ms
30,780 KB
testcase_09 AC 40 ms
31,168 KB
testcase_10 AC 40 ms
30,920 KB
testcase_11 AC 41 ms
30,800 KB
testcase_12 AC 40 ms
30,948 KB
testcase_13 AC 40 ms
30,932 KB
testcase_14 WA -
testcase_15 AC 41 ms
30,848 KB
testcase_16 WA -
testcase_17 AC 40 ms
30,936 KB
testcase_18 AC 39 ms
31,208 KB
testcase_19 AC 40 ms
30,904 KB
testcase_20 AC 40 ms
30,956 KB
testcase_21 AC 40 ms
30,892 KB
testcase_22 AC 40 ms
30,912 KB
testcase_23 AC 40 ms
31,016 KB
testcase_24 AC 40 ms
30,920 KB
testcase_25 AC 40 ms
31,128 KB
testcase_26 AC 40 ms
31,056 KB
testcase_27 AC 40 ms
30,932 KB
testcase_28 AC 39 ms
30,916 KB
testcase_29 AC 40 ms
30,912 KB
testcase_30 AC 40 ms
30,940 KB
testcase_31 AC 41 ms
30,912 KB
testcase_32 AC 40 ms
30,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
if(strlen($a) > 2 && strlen($b) > 2)
{
    $ans = 'P';
}
else
{
    $a = substr($a, -2);
    $b = substr($b, -2);
    $p = $a * $b;
    $s = $a + $b;
    if($p > $s)
    {
        $ans = 'P';
    }
    else if ($p < $s)
    {
        $ans = 'S';
    }
    else
    {
        $ans = 'E';
    }
}
echo $ans.PHP_EOL;
0