結果
問題 |
No.312 置換処理
|
ユーザー |
![]() |
提出日時 | 2019-03-20 16:30:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 416 bytes |
コンパイル時間 | 87 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-19 00:45:23 |
合計ジャッジ時間 | 3,937 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 39 WA * 6 |
ソースコード
n = int(input()) a = n 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 a % 4 == 0 and ans[1] != 3: print(4) else: print(ans[1]) else: print(ans[1]) else: print([4, ans[0]][ans[0]!=2])