結果

問題 No.843 Triple Primes
ユーザー sho_00sho_00
提出日時 2020-04-11 20:06:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 498 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 175,488 KB
最終ジャッジ日時 2024-09-19 08:13:47
合計ジャッジ時間 43,658 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 TLE * 1
other AC * 33 RE * 2 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

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