結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 48 ms
31,328 KB
testcase_02 AC 101 ms
31,152 KB
testcase_03 AC 52 ms
31,332 KB
testcase_04 AC 36 ms
31,160 KB
testcase_05 AC 36 ms
31,220 KB
testcase_06 AC 38 ms
31,412 KB
testcase_07 AC 59 ms
31,336 KB
testcase_08 AC 43 ms
31,572 KB
testcase_09 AC 38 ms
31,084 KB
testcase_10 AC 38 ms
31,072 KB
testcase_11 AC 43 ms
31,296 KB
testcase_12 AC 38 ms
31,060 KB
testcase_13 AC 38 ms
31,328 KB
testcase_14 AC 38 ms
31,184 KB
testcase_15 AC 39 ms
31,456 KB
testcase_16 AC 38 ms
31,224 KB
testcase_17 AC 39 ms
31,444 KB
testcase_18 AC 39 ms
31,068 KB
testcase_19 AC 38 ms
31,372 KB
testcase_20 AC 38 ms
31,332 KB
testcase_21 AC 37 ms
31,200 KB
testcase_22 AC 38 ms
30,960 KB
testcase_23 WA -
testcase_24 AC 38 ms
30,992 KB
testcase_25 AC 38 ms
31,336 KB
testcase_26 AC 38 ms
31,340 KB
testcase_27 AC 38 ms
31,544 KB
testcase_28 AC 36 ms
31,352 KB
testcase_29 AC 37 ms
31,328 KB
testcase_30 AC 40 ms
31,288 KB
testcase_31 AC 40 ms
31,284 KB
testcase_32 AC 45 ms
31,444 KB
testcase_33 AC 57 ms
31,128 KB
testcase_34 AC 56 ms
31,112 KB
testcase_35 AC 40 ms
31,496 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 38 ms
31,280 KB
testcase_39 AC 38 ms
31,060 KB
testcase_40 AC 38 ms
31,256 KB
testcase_41 AC 39 ms
31,196 KB
testcase_42 AC 39 ms
31,220 KB
testcase_43 AC 37 ms
31,028 KB
testcase_44 AC 37 ms
31,436 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = 2;$i <= $root; $i++)
{
    if(!($num % $i))
    {
        if(!($i % 2))
        {
            $i *= 2;
        }
        $ans = $i;
        break;
    }
}
echo ($ans == 0)?$num:$i;
echo PHP_EOL;
0