結果
| 問題 |
No.8093 Please GCD
|
| コンテスト | |
| ユーザー |
nasubi24
|
| 提出日時 | 2022-04-01 22:37:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 574 bytes |
| コンパイル時間 | 161 ms |
| コンパイル使用メモリ | 82,216 KB |
| 実行使用メモリ | 94,440 KB |
| 平均クエリ数 | 8095.77 |
| 最終ジャッジ日時 | 2024-11-20 10:34:54 |
| 合計ジャッジ時間 | 20,029 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 16 |
ソースコード
import math
n=int(input())
p=[]
for i in range(2,n+1):
for j in range(2,i):
if i%j==0:
break
else:
p.append(i)
now=0
num=1
num2=1
cnt=0
while now!=len(p) and (n//num)+cnt<=620:
tem=1
while now!=len(p):
if tem*p[now]>n:
break
tem*=p[now]
now+=1
cnt+=1
print("?",tem,flush=True)
k=int(input())
num*=k
num2*=tem//k
ans=num
for i in range(2,(n//num)+1):
if math.gcd(num2,i)==1:
print("?",num*i,flush=True)
ans=max(ans,int(input()))
print("!",ans,flush=True)
nasubi24