結果

問題 No.312 置換処理
ユーザー magurogumamaguroguma
提出日時 2017-08-14 20:00:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-21 11:27:14
合計ジャッジ時間 3,916 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 39 ms
10,496 KB
testcase_02 AC 357 ms
10,496 KB
testcase_03 AC 34 ms
10,496 KB
testcase_04 AC 34 ms
10,496 KB
testcase_05 AC 35 ms
10,496 KB
testcase_06 WA -
testcase_07 AC 120 ms
10,496 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 62 ms
10,496 KB
testcase_12 WA -
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 32 ms
10,496 KB
testcase_23 WA -
testcase_24 AC 35 ms
10,496 KB
testcase_25 AC 34 ms
10,496 KB
testcase_26 AC 35 ms
10,496 KB
testcase_27 AC 33 ms
10,496 KB
testcase_28 AC 34 ms
10,624 KB
testcase_29 AC 34 ms
10,496 KB
testcase_30 AC 33 ms
10,496 KB
testcase_31 WA -
testcase_32 AC 61 ms
10,496 KB
testcase_33 AC 125 ms
10,624 KB
testcase_34 AC 128 ms
10,624 KB
testcase_35 AC 42 ms
10,496 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 34 ms
10,624 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 36 ms
10,496 KB
testcase_43 AC 37 ms
10,496 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N = int(input())

i = 2
is_prime = True
while i*i<=N:
    if N%i == 0:
        is_prime = False
        break
    i += 1

if is_prime:
    print(N)
else:
    if i == 2:
        print(N//2)
    else:
        print(i)
0