結果

問題 No.843 Triple Primes
ユーザー matriematrie
提出日時 2021-01-09 09:02:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 32,256 KB
最終ジャッジ日時 2023-08-10 23:15:35
合計ジャッジ時間 5,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,764 KB
testcase_01 AC 135 ms
32,256 KB
testcase_02 AC 15 ms
8,376 KB
testcase_03 AC 16 ms
8,228 KB
testcase_04 AC 17 ms
8,520 KB
testcase_05 AC 16 ms
8,360 KB
testcase_06 AC 17 ms
8,528 KB
testcase_07 AC 118 ms
27,760 KB
testcase_08 AC 123 ms
29,532 KB
testcase_09 AC 135 ms
32,052 KB
testcase_10 AC 113 ms
28,412 KB
testcase_11 AC 134 ms
30,292 KB
testcase_12 AC 133 ms
31,696 KB
testcase_13 AC 130 ms
31,076 KB
testcase_14 AC 130 ms
31,100 KB
testcase_15 AC 114 ms
28,032 KB
testcase_16 AC 117 ms
28,360 KB
testcase_17 AC 15 ms
8,112 KB
testcase_18 AC 15 ms
7,828 KB
testcase_19 AC 15 ms
7,800 KB
testcase_20 AC 45 ms
14,368 KB
testcase_21 AC 31 ms
11,692 KB
testcase_22 AC 83 ms
22,428 KB
testcase_23 AC 88 ms
22,940 KB
testcase_24 AC 47 ms
14,544 KB
testcase_25 AC 37 ms
13,328 KB
testcase_26 AC 131 ms
31,972 KB
testcase_27 AC 21 ms
9,300 KB
testcase_28 AC 131 ms
31,360 KB
testcase_29 AC 49 ms
15,152 KB
testcase_30 AC 131 ms
31,696 KB
testcase_31 AC 24 ms
10,196 KB
testcase_32 AC 19 ms
9,312 KB
testcase_33 AC 51 ms
15,888 KB
testcase_34 AC 75 ms
21,308 KB
testcase_35 AC 135 ms
32,120 KB
testcase_36 AC 38 ms
12,652 KB
testcase_37 AC 107 ms
27,144 KB
testcase_38 AC 93 ms
24,488 KB
testcase_39 AC 131 ms
31,524 KB
testcase_40 AC 15 ms
7,864 KB
testcase_41 AC 15 ms
8,128 KB
testcase_42 AC 118 ms
29,156 KB
testcase_43 AC 130 ms
30,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())+1
if n<3: print(0);exit(0)
L=list(range(n))
s=set()
for i in L:
	if L[i]<2:continue
	L[::i]=[0]*(n//i+(n%i>0))
	s.add(i)
c=0
a=set()
for p in s:
	if p*p-2 in s: c+=2
print(c-1)
0