結果

問題 No.843 Triple Primes
ユーザー _matumo__matumo_
提出日時 2021-01-17 23:20:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 500 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 20,200 KB
最終ジャッジ日時 2023-08-20 05:18:44
合計ジャッジ時間 12,535 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,864 KB
testcase_01 AC 498 ms
20,052 KB
testcase_02 AC 17 ms
8,528 KB
testcase_03 AC 16 ms
7,808 KB
testcase_04 AC 18 ms
8,524 KB
testcase_05 AC 17 ms
7,948 KB
testcase_06 AC 19 ms
8,480 KB
testcase_07 AC 363 ms
17,616 KB
testcase_08 AC 413 ms
18,676 KB
testcase_09 AC 480 ms
20,156 KB
testcase_10 AC 385 ms
18,008 KB
testcase_11 AC 443 ms
19,044 KB
testcase_12 AC 477 ms
19,908 KB
testcase_13 AC 458 ms
19,508 KB
testcase_14 AC 454 ms
19,644 KB
testcase_15 AC 376 ms
18,060 KB
testcase_16 AC 381 ms
17,992 KB
testcase_17 AC 16 ms
8,132 KB
testcase_18 AC 15 ms
8,272 KB
testcase_19 AC 16 ms
7,916 KB
testcase_20 AC 94 ms
11,416 KB
testcase_21 AC 52 ms
9,996 KB
testcase_22 AC 223 ms
14,828 KB
testcase_23 AC 232 ms
15,124 KB
testcase_24 AC 100 ms
11,796 KB
testcase_25 AC 74 ms
10,956 KB
testcase_26 AC 500 ms
20,072 KB
testcase_27 AC 27 ms
9,072 KB
testcase_28 AC 461 ms
19,724 KB
testcase_29 AC 109 ms
11,972 KB
testcase_30 AC 476 ms
19,888 KB
testcase_31 AC 34 ms
9,404 KB
testcase_32 AC 25 ms
9,104 KB
testcase_33 AC 121 ms
12,456 KB
testcase_34 AC 202 ms
14,272 KB
testcase_35 AC 488 ms
20,200 KB
testcase_36 AC 65 ms
10,668 KB
testcase_37 AC 347 ms
17,404 KB
testcase_38 AC 270 ms
16,056 KB
testcase_39 AC 472 ms
19,592 KB
testcase_40 AC 16 ms
8,248 KB
testcase_41 AC 16 ms
8,064 KB
testcase_42 AC 395 ms
18,460 KB
testcase_43 AC 442 ms
19,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
if N<3:	print(N-1);exit()
rn=int(N**0.5)+2
k,*pa=[n for n in range(3,N+1,2)]
pr=[]
while k<rn:
	pr+=[k]
	pa=[n for n in pa if n%k>0]
	k=pa[0]
pa=pr+pa
cn=0
for r in pr:
	if r*r-2 in pa:	cn+=1
print(cn*2+1)
0