結果

問題 No.36 素数が嫌い!
ユーザー Konton7Konton7
提出日時 2019-05-17 15:48:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 11,796 KB
実行使用メモリ 237,312 KB
最終ジャッジ日時 2023-10-17 07:21:42
合計ジャッジ時間 12,802 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
115,360 KB
testcase_01 AC 632 ms
186,684 KB
testcase_02 AC 29 ms
10,084 KB
testcase_03 AC 29 ms
10,020 KB
testcase_04 AC 29 ms
10,084 KB
testcase_05 AC 32 ms
10,572 KB
testcase_06 AC 32 ms
10,684 KB
testcase_07 AC 32 ms
10,688 KB
testcase_08 AC 29 ms
10,280 KB
testcase_09 AC 30 ms
10,556 KB
testcase_10 AC 31 ms
10,536 KB
testcase_11 AC 360 ms
83,848 KB
testcase_12 AC 1,043 ms
237,312 KB
testcase_13 WA -
testcase_14 AC 270 ms
150,984 KB
testcase_15 AC 29 ms
10,084 KB
testcase_16 AC 29 ms
10,084 KB
testcase_17 AC 28 ms
9,988 KB
testcase_18 AC 29 ms
10,172 KB
testcase_19 AC 434 ms
98,432 KB
testcase_20 AC 946 ms
236,784 KB
testcase_21 AC 808 ms
183,252 KB
testcase_22 AC 836 ms
188,740 KB
testcase_23 AC 511 ms
117,208 KB
testcase_24 AC 343 ms
129,288 KB
testcase_25 AC 224 ms
127,372 KB
testcase_26 AC 659 ms
147,552 KB
testcase_27 AC 914 ms
204,824 KB
testcase_28 AC 645 ms
144,980 KB
testcase_29 AC 1,018 ms
230,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
plist = [2] + [ i for i in range(3,int(n**0.5)+2,2) ]

if n < 7:
    print("NO")

else:
    q = 0
    clist = []
    for i in plist:
        if n % i == 0:
            clist.append(i)
            n //= i
            if n % i == 0:
                print("YES")
                q = 1
                break
            elif len(clist) == 3:
                print("YES")
                q = 1
                break
    if q == 0:
        if len(clist) == 2 and n != 1:
            print("YES")
        else:
            print("NO")
0