結果
| 問題 |
No.8093 Please GCD
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-01 22:40:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 542 bytes |
| コンパイル時間 | 395 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 94,936 KB |
| 平均クエリ数 | 505.00 |
| 最終ジャッジ日時 | 2024-11-20 10:41:01 |
| 合計ジャッジ時間 | 10,015 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 RE * 24 |
ソースコード
N = int(input())
isp = [i>=2 for i in range(N+1)]
for i in range(2,N+1):
if not isp[i]:continue
for j in range(i+i,N+1,i):isp[j] = False
ans = 1
query = 1
cnt = 0
for i in range(2,N+1):
if not isp[i]:continue
now = 1
while now*i <= N:now*=i
if query*now > N:
print("?",query,flush=True)
ans *= int(input())
cnt += 1
if cnt > 600:
assert False
query = now
else:
query *= now
if query > 1:
print("?",query,flush=True)
ans *= int(input())
cnt += 1
if cnt > 600:
assert False
print("!",ans)