結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
10,104 KB
testcase_01 AC 183 ms
10,104 KB
testcase_02 AC 341 ms
10,104 KB
testcase_03 AC 247 ms
10,104 KB
testcase_04 AC 30 ms
10,104 KB
testcase_05 WA -
testcase_06 AC 47 ms
10,104 KB
testcase_07 WA -
testcase_08 AC 43 ms
10,104 KB
testcase_09 AC 50 ms
10,104 KB
testcase_10 AC 32 ms
10,104 KB
testcase_11 WA -
testcase_12 AC 30 ms
10,104 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 30 ms
10,104 KB
testcase_23 AC 30 ms
10,104 KB
testcase_24 AC 30 ms
10,104 KB
testcase_25 AC 30 ms
10,104 KB
testcase_26 AC 30 ms
10,104 KB
testcase_27 AC 29 ms
10,104 KB
testcase_28 AC 30 ms
10,104 KB
testcase_29 AC 30 ms
10,104 KB
testcase_30 AC 60 ms
10,104 KB
testcase_31 WA -
testcase_32 AC 60 ms
10,104 KB
testcase_33 AC 129 ms
10,104 KB
testcase_34 AC 128 ms
10,104 KB
testcase_35 WA -
testcase_36 AC 30 ms
10,104 KB
testcase_37 AC 31 ms
10,104 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 31 ms
10,104 KB
testcase_41 AC 30 ms
10,104 KB
testcase_42 WA -
testcase_43 AC 30 ms
10,104 KB
testcase_44 AC 30 ms
10,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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