結果

問題 No.36 素数が嫌い!
ユーザー gorugo30gorugo30
提出日時 2021-02-25 21:59:24
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 76,676 KB
最終ジャッジ日時 2023-07-24 17:56:09
合計ジャッジ時間 4,789 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 75 ms
71,496 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 78 ms
75,844 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 121 ms
75,776 KB
testcase_12 AC 209 ms
75,740 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 75 ms
71,828 KB
testcase_17 AC 76 ms
71,456 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N == 1:
    print("NO")
    exit()

def isp(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True
if isp(N):
    print("NO")
    exit()

for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        N //= i
        print(i)
        break
if isp(N):
    print("NO")
    exit()
for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        print(i)
        N //= i
        break
if N == 1:
    print("NO")
else:
    print("YES")
0