結果

問題 No.843 Triple Primes
ユーザー sho_00sho_00
提出日時 2020-04-11 20:06:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 498 bytes
コンパイル時間 946 ms
コンパイル使用メモリ 81,544 KB
実行使用メモリ 175,076 KB
最終ジャッジ日時 2023-10-19 12:09:39
合計ジャッジ時間 48,331 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,548 KB
testcase_01 TLE -
testcase_02 AC 48 ms
61,464 KB
testcase_03 AC 47 ms
59,416 KB
testcase_04 AC 50 ms
63,916 KB
testcase_05 AC 47 ms
61,464 KB
testcase_06 AC 51 ms
63,916 KB
testcase_07 AC 1,616 ms
152,108 KB
testcase_08 AC 1,880 ms
158,972 KB
testcase_09 TLE -
testcase_10 AC 1,715 ms
153,692 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 1,653 ms
153,164 KB
testcase_16 AC 1,694 ms
153,428 KB
testcase_17 RE -
testcase_18 AC 40 ms
53,560 KB
testcase_19 AC 39 ms
53,560 KB
testcase_20 AC 287 ms
89,884 KB
testcase_21 AC 135 ms
78,000 KB
testcase_22 AC 865 ms
123,148 KB
testcase_23 AC 920 ms
125,260 KB
testcase_24 AC 313 ms
91,732 KB
testcase_25 AC 215 ms
84,340 KB
testcase_26 TLE -
testcase_27 AC 68 ms
72,340 KB
testcase_28 TLE -
testcase_29 AC 345 ms
93,580 KB
testcase_30 TLE -
testcase_31 AC 90 ms
76,140 KB
testcase_32 AC 62 ms
70,264 KB
testcase_33 AC 398 ms
97,276 KB
testcase_34 AC 756 ms
117,604 KB
testcase_35 TLE -
testcase_36 AC 185 ms
81,700 KB
testcase_37 AC 1,499 ms
146,840 KB
testcase_38 AC 1,129 ms
133,708 KB
testcase_39 TLE -
testcase_40 AC 40 ms
53,560 KB
testcase_41 RE -
testcase_42 AC 1,792 ms
157,136 KB
testcase_43 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N=int(input())

def searchPrimeNum(N):  # 素数列挙 こっち使う
  max = int(math.sqrt(N))
  searchList = [i for i in range(2,N+1)]
  primeNum = []
  while searchList[0] <= max:
    primeNum.append(searchList[0])
    tmp = searchList[0]
    searchList = [i for i in searchList if i % tmp != 0]
  primeNum.extend(searchList)
  return primeNum


table=searchPrimeNum(N)
cnt=0
for r in table:
  p=r**2-2
  if p in table:
    if p!=2:
      cnt+=2
    else:
      cnt+=1
print(cnt)
0