結果
| 問題 | No.1058 素敵な数 |
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2022-08-26 11:42:13 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 561 bytes |
| 記録 | |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 82,324 KB |
| 実行使用メモリ | 74,912 KB |
| 最終ジャッジ日時 | 2024-10-13 13:44:12 |
| 合計ジャッジ時間 | 1,341 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 8 |
ソースコード
x=int(input())
x-=1
if x == 0:
print(1)
exit()
def c(n):
sosu=[True]*(n+1)
sosu[0],sosu[1] = False,False
cnt=0
for i in range(4,n+1,2):
sosu[i] = False
for i in range(3,int(n**0.5)+1,2):
if sosu[i] == False:
continue
for j in range(i,n//i+1,2):
sosu[j*i]=False
return [p for p in range(n + 1) if sosu[p]==True]
n=10**6
t=c(n)
cnt=0
for i in range(len(t)):
if t[i] > 10**5:
cnt+=1
if cnt == x:
print(t[i]**2)
break
lllllll88938494