結果

問題 No.312 置換処理
ユーザー todo_2marikotodo_2mariko
提出日時 2019-03-20 16:10:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 10,128 KB
最終ジャッジ日時 2023-10-19 04:27:11
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 341 ms
10,044 KB
testcase_03 WA -
testcase_04 AC 30 ms
10,044 KB
testcase_05 AC 37 ms
10,076 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 47 ms
10,076 KB
testcase_09 AC 57 ms
10,076 KB
testcase_10 AC 34 ms
10,076 KB
testcase_11 AC 59 ms
10,076 KB
testcase_12 WA -
testcase_13 AC 31 ms
10,076 KB
testcase_14 AC 31 ms
10,076 KB
testcase_15 AC 46 ms
10,076 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 34 ms
10,076 KB
testcase_19 WA -
testcase_20 AC 48 ms
10,076 KB
testcase_21 AC 32 ms
10,076 KB
testcase_22 AC 29 ms
10,044 KB
testcase_23 AC 31 ms
10,076 KB
testcase_24 AC 30 ms
10,044 KB
testcase_25 AC 30 ms
10,076 KB
testcase_26 AC 30 ms
10,044 KB
testcase_27 AC 30 ms
10,076 KB
testcase_28 AC 30 ms
10,076 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 70 ms
10,076 KB
testcase_32 AC 59 ms
10,044 KB
testcase_33 AC 124 ms
10,044 KB
testcase_34 AC 126 ms
10,044 KB
testcase_35 WA -
testcase_36 AC 30 ms
10,076 KB
testcase_37 AC 33 ms
10,076 KB
testcase_38 AC 30 ms
10,076 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 31 ms
10,076 KB
testcase_44 AC 30 ms
10,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
table = set()
i = 2

while i * i <= n:
    while n % i == 0:
        n /= i
        table.add(i)
    i += 1
if n > 1:
    table.add(n)
    
ans = list(table)
if len(ans) >= 2:
    if ans[1] == 3:
        print(3)
    elif ans[0] == 2:
        print(4)
    else:
        print(ans[0])
else:
    print([4, ans[0]][ans[0]!=2])
0