結果

問題 No.3093 Please GCD
ユーザー nasubi24nasubi24
提出日時 2022-04-01 22:43:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 93,836 KB
平均クエリ数 711.17
最終ジャッジ日時 2024-04-30 15:02:15
合計ジャッジ時間 9,576 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
69,680 KB
testcase_01 AC 59 ms
74,540 KB
testcase_02 AC 69 ms
76,920 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 325 ms
92,884 KB
testcase_06 AC 173 ms
82,308 KB
testcase_07 AC 208 ms
82,696 KB
testcase_08 AC 321 ms
93,288 KB
testcase_09 AC 173 ms
82,592 KB
testcase_10 RE -
testcase_11 AC 95 ms
82,312 KB
testcase_12 WA -
testcase_13 AC 350 ms
93,236 KB
testcase_14 AC 215 ms
82,020 KB
testcase_15 AC 70 ms
77,520 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 186 ms
82,924 KB
testcase_20 AC 192 ms
82,492 KB
testcase_21 AC 222 ms
82,384 KB
testcase_22 WA -
testcase_23 AC 203 ms
83,596 KB
testcase_24 AC 171 ms
84,412 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 235 ms
83,004 KB
testcase_29 AC 217 ms
82,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 cnt<=450:
    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((n//num),-1,-1):
    if math.gcd(num2,i)==1:
        print("?",num*i,flush=True)
        ans=max(ans,int(input()))
print("!",ans,flush=True)
0