結果
| 問題 |
No.2081 Make a Test Case of GCD Subset
|
| コンテスト | |
| ユーザー |
lilictaka
|
| 提出日時 | 2022-09-26 23:39:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 627 bytes |
| コンパイル時間 | 383 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 71,808 KB |
| 最終ジャッジ日時 | 2024-12-22 16:05:23 |
| 合計ジャッジ時間 | 6,699 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 RE * 24 |
ソースコード
def erastotenes(n):
is_prime = [True] *(n+1)
is_prime[1] = False
for p in range(2,n+1):
if is_prime[p] == False:
continue
is_prime[p] = True
k = 2
while k * p < (n+1):
is_prime[k*p] = False
k +=1
return is_prime
M = int(input())
if M == 0:
M = 998244353
P = erastotenes(10 ** 5 + 1)
ans = []
for p in range(2,10**5+1):
if P[p]:
cnt =1
while pow(p,cnt) <=10 ** 5 and pow(2,cnt) -1 <=M:
ans.append(pow(p,cnt))
cnt +=1
M-=pow(2,cnt-1) -1
if M:
print(error)
print(len(ans))
print(*ans)
lilictaka