結果

問題 No.312 置換処理
ユーザー papinianuspapinianus
提出日時 2016-09-21 12:57:45
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 30,840 KB
実行使用メモリ 31,140 KB
最終ジャッジ日時 2024-04-28 16:42:13
合計ジャッジ時間 3,472 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
30,812 KB
testcase_01 AC 48 ms
31,004 KB
testcase_02 AC 75 ms
30,972 KB
testcase_03 AC 49 ms
31,060 KB
testcase_04 AC 40 ms
31,128 KB
testcase_05 AC 41 ms
30,996 KB
testcase_06 AC 41 ms
30,992 KB
testcase_07 AC 50 ms
30,976 KB
testcase_08 AC 40 ms
30,928 KB
testcase_09 AC 41 ms
30,944 KB
testcase_10 AC 40 ms
31,076 KB
testcase_11 AC 44 ms
30,996 KB
testcase_12 AC 42 ms
30,972 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 42 ms
30,876 KB
testcase_23 WA -
testcase_24 AC 40 ms
30,836 KB
testcase_25 AC 40 ms
30,916 KB
testcase_26 AC 40 ms
30,744 KB
testcase_27 WA -
testcase_28 AC 41 ms
30,748 KB
testcase_29 AC 40 ms
30,888 KB
testcase_30 AC 44 ms
30,800 KB
testcase_31 WA -
testcase_32 AC 45 ms
31,036 KB
testcase_33 AC 52 ms
30,888 KB
testcase_34 AC 52 ms
31,092 KB
testcase_35 AC 41 ms
30,816 KB
testcase_36 AC 41 ms
31,040 KB
testcase_37 AC 41 ms
31,020 KB
testcase_38 WA -
testcase_39 AC 41 ms
31,056 KB
testcase_40 AC 41 ms
30,968 KB
testcase_41 AC 40 ms
30,976 KB
testcase_42 AC 40 ms
31,092 KB
testcase_43 AC 40 ms
31,128 KB
testcase_44 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

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