結果

問題 No.312 置換処理
ユーザー papinianuspapinianus
提出日時 2016-09-21 13:11:53
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 31,040 KB
実行使用メモリ 31,260 KB
最終ジャッジ日時 2024-04-28 16:43:20
合計ジャッジ時間 3,369 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,872 KB
testcase_01 AC 85 ms
30,620 KB
testcase_02 AC 107 ms
30,508 KB
testcase_03 AC 106 ms
30,604 KB
testcase_04 AC 41 ms
30,824 KB
testcase_05 AC 41 ms
30,880 KB
testcase_06 AC 45 ms
31,028 KB
testcase_07 AC 59 ms
30,936 KB
testcase_08 AC 41 ms
30,908 KB
testcase_09 AC 42 ms
30,776 KB
testcase_10 AC 41 ms
30,600 KB
testcase_11 AC 46 ms
30,460 KB
testcase_12 AC 41 ms
30,632 KB
testcase_13 AC 41 ms
30,504 KB
testcase_14 AC 41 ms
30,512 KB
testcase_15 AC 40 ms
30,688 KB
testcase_16 AC 40 ms
30,676 KB
testcase_17 AC 41 ms
30,940 KB
testcase_18 AC 41 ms
30,536 KB
testcase_19 AC 40 ms
30,588 KB
testcase_20 AC 40 ms
30,848 KB
testcase_21 AC 40 ms
30,596 KB
testcase_22 AC 41 ms
30,620 KB
testcase_23 WA -
testcase_24 AC 40 ms
30,552 KB
testcase_25 AC 41 ms
30,728 KB
testcase_26 AC 40 ms
30,832 KB
testcase_27 AC 40 ms
30,812 KB
testcase_28 AC 40 ms
30,632 KB
testcase_29 AC 40 ms
30,984 KB
testcase_30 AC 49 ms
30,764 KB
testcase_31 AC 42 ms
30,712 KB
testcase_32 AC 47 ms
30,668 KB
testcase_33 AC 61 ms
30,740 KB
testcase_34 AC 62 ms
30,812 KB
testcase_35 AC 43 ms
30,780 KB
testcase_36 AC 41 ms
30,660 KB
testcase_37 AC 41 ms
30,756 KB
testcase_38 AC 39 ms
30,808 KB
testcase_39 AC 41 ms
30,768 KB
testcase_40 AC 40 ms
30,456 KB
testcase_41 AC 41 ms
30,660 KB
testcase_42 AC 41 ms
30,836 KB
testcase_43 AC 40 ms
30,836 KB
testcase_44 AC 42 ms
30,832 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$num = trim(fgets(STDIN));
$root = floor(sqrt($num));
$ans = 0;
for($i = 3;$i <= $root; $i++)
{
    if(!($num % $i))
    {
        $ans = $i;
        break;
    }
}
if($ans == 0)
{
    if($num % 2)
    {
        echo $num;
    }
    else
    {
        echo $num / 2;
    }
}
else {
    echo $ans;
}
echo PHP_EOL;
0