結果
| 問題 | No.843 Triple Primes |
| コンテスト | |
| ユーザー |
sho_00
|
| 提出日時 | 2020-04-11 20:06:38 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 200 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 196,224 KB |
| 最終ジャッジ日時 | 2026-04-07 17:09:15 |
| 合計ジャッジ時間 | 35,164 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 RE * 2 |
ソースコード
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)
sho_00