結果

問題 No.843 Triple Primes
ユーザー ntudantuda
提出日時 2024-02-03 18:58:43
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 512 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 175,352 KB
最終ジャッジ日時 2024-02-03 18:58:59
合計ジャッジ時間 14,731 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,588 KB
testcase_01 AC 594 ms
175,352 KB
testcase_02 AC 43 ms
61,972 KB
testcase_03 AC 43 ms
61,976 KB
testcase_04 AC 45 ms
64,156 KB
testcase_05 AC 44 ms
61,972 KB
testcase_06 AC 46 ms
64,148 KB
testcase_07 AC 393 ms
152,456 KB
testcase_08 AC 468 ms
159,368 KB
testcase_09 AC 551 ms
173,992 KB
testcase_10 AC 427 ms
153,888 KB
testcase_11 AC 479 ms
165,376 KB
testcase_12 AC 527 ms
170,072 KB
testcase_13 AC 518 ms
167,704 KB
testcase_14 AC 506 ms
167,720 KB
testcase_15 AC 401 ms
153,644 KB
testcase_16 AC 422 ms
153,796 KB
testcase_17 RE -
testcase_18 AC 37 ms
53,588 KB
testcase_19 AC 36 ms
53,588 KB
testcase_20 AC 119 ms
90,056 KB
testcase_21 AC 82 ms
78,256 KB
testcase_22 AC 236 ms
123,372 KB
testcase_23 AC 254 ms
125,572 KB
testcase_24 AC 121 ms
92,020 KB
testcase_25 AC 115 ms
84,588 KB
testcase_26 AC 554 ms
173,960 KB
testcase_27 AC 53 ms
72,560 KB
testcase_28 AC 534 ms
168,992 KB
testcase_29 AC 130 ms
93,948 KB
testcase_30 AC 537 ms
170,656 KB
testcase_31 AC 64 ms
76,148 KB
testcase_32 AC 53 ms
70,484 KB
testcase_33 AC 149 ms
97,656 KB
testcase_34 AC 219 ms
117,848 KB
testcase_35 AC 554 ms
174,000 KB
testcase_36 AC 98 ms
81,952 KB
testcase_37 AC 374 ms
147,272 KB
testcase_38 AC 284 ms
133,832 KB
testcase_39 AC 524 ms
169,816 KB
testcase_40 AC 36 ms
53,588 KB
testcase_41 RE -
testcase_42 AC 446 ms
157,500 KB
testcase_43 AC 479 ms
165,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
def seachPrimeNum(N):
    max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

PL = seachPrimeNum(N)
PLS = set(PL)
ans = 0
for r in PL:
    r2 = r * r
    if r2 > 2 * N:
        break
    for p in PL:
        if r2 - p in PLS:
            ans += 1
print(ans)




0