結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
30,844 KB
testcase_01 AC 53 ms
30,576 KB
testcase_02 AC 106 ms
30,764 KB
testcase_03 AC 57 ms
30,600 KB
testcase_04 AC 40 ms
31,028 KB
testcase_05 AC 40 ms
30,624 KB
testcase_06 AC 42 ms
30,584 KB
testcase_07 AC 59 ms
31,032 KB
testcase_08 AC 40 ms
30,792 KB
testcase_09 AC 40 ms
31,080 KB
testcase_10 AC 41 ms
30,876 KB
testcase_11 AC 47 ms
30,556 KB
testcase_12 AC 41 ms
30,716 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 42 ms
31,052 KB
testcase_17 AC 41 ms
30,856 KB
testcase_18 AC 41 ms
30,836 KB
testcase_19 WA -
testcase_20 AC 40 ms
30,824 KB
testcase_21 AC 41 ms
30,724 KB
testcase_22 AC 40 ms
30,724 KB
testcase_23 WA -
testcase_24 AC 40 ms
30,768 KB
testcase_25 AC 40 ms
30,664 KB
testcase_26 AC 40 ms
31,004 KB
testcase_27 AC 40 ms
30,896 KB
testcase_28 AC 41 ms
30,560 KB
testcase_29 AC 42 ms
30,708 KB
testcase_30 AC 43 ms
30,628 KB
testcase_31 WA -
testcase_32 AC 46 ms
30,808 KB
testcase_33 AC 62 ms
30,536 KB
testcase_34 AC 61 ms
30,908 KB
testcase_35 AC 43 ms
30,392 KB
testcase_36 WA -
testcase_37 AC 40 ms
30,512 KB
testcase_38 WA -
testcase_39 AC 40 ms
30,908 KB
testcase_40 AC 40 ms
30,740 KB
testcase_41 AC 40 ms
30,564 KB
testcase_42 AC 40 ms
30,920 KB
testcase_43 AC 40 ms
30,528 KB
testcase_44 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

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