結果

問題 No.843 Triple Primes
ユーザー _matumo__matumo_
提出日時 2021-01-17 16:44:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 224 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 22,528 KB
最終ジャッジ日時 2024-05-07 06:02:34
合計ジャッジ時間 13,231 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,496 KB
testcase_01 AC 576 ms
22,528 KB
testcase_02 AC 28 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 29 ms
10,880 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 AC 417 ms
19,840 KB
testcase_08 AC 488 ms
20,992 KB
testcase_09 AC 572 ms
22,400 KB
testcase_10 AC 445 ms
20,608 KB
testcase_11 AC 501 ms
21,632 KB
testcase_12 AC 554 ms
22,144 KB
testcase_13 AC 514 ms
21,888 KB
testcase_14 AC 513 ms
21,760 KB
testcase_15 AC 425 ms
20,352 KB
testcase_16 AC 446 ms
20,352 KB
testcase_17 AC 26 ms
10,624 KB
testcase_18 RE -
testcase_19 AC 26 ms
10,752 KB
testcase_20 AC 118 ms
13,952 KB
testcase_21 AC 69 ms
12,288 KB
testcase_22 AC 267 ms
17,152 KB
testcase_23 AC 272 ms
17,408 KB
testcase_24 AC 126 ms
14,208 KB
testcase_25 AC 92 ms
13,184 KB
testcase_26 AC 555 ms
22,272 KB
testcase_27 AC 40 ms
11,136 KB
testcase_28 AC 545 ms
22,016 KB
testcase_29 AC 134 ms
14,208 KB
testcase_30 AC 532 ms
22,016 KB
testcase_31 AC 47 ms
11,520 KB
testcase_32 AC 37 ms
11,136 KB
testcase_33 AC 141 ms
14,720 KB
testcase_34 AC 229 ms
16,512 KB
testcase_35 AC 552 ms
22,400 KB
testcase_36 AC 91 ms
13,056 KB
testcase_37 AC 442 ms
19,840 KB
testcase_38 AC 335 ms
18,176 KB
testcase_39 AC 557 ms
21,888 KB
testcase_40 RE -
testcase_41 AC 27 ms
10,624 KB
testcase_42 WA -
testcase_43 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
if N<2:	print(0);exit()
rn=int(N**0.5)+1
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
cn=cn*2+1
print(cn)
0