結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 207 ms
115,360 KB
testcase_01 AC 643 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 33 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 367 ms
83,848 KB
testcase_12 AC 1,103 ms
237,312 KB
testcase_13 AC 1,055 ms
236,784 KB
testcase_14 AC 266 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 438 ms
98,432 KB
testcase_20 AC 952 ms
236,784 KB
testcase_21 AC 814 ms
183,252 KB
testcase_22 AC 862 ms
188,740 KB
testcase_23 AC 512 ms
117,208 KB
testcase_24 AC 342 ms
129,288 KB
testcase_25 AC 225 ms
127,372 KB
testcase_26 AC 656 ms
147,552 KB
testcase_27 AC 912 ms
204,824 KB
testcase_28 AC 658 ms
144,980 KB
testcase_29 AC 1,031 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 and n != i:
                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