結果

問題 No.3093 Please GCD
ユーザー nasubi24nasubi24
提出日時 2022-04-01 22:38:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 94,104 KB
平均クエリ数 552.77
最終ジャッジ日時 2024-04-30 14:55:39
合計ジャッジ時間 9,254 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
70,648 KB
testcase_01 AC 68 ms
74,948 KB
testcase_02 AC 84 ms
76,948 KB
testcase_03 AC 206 ms
83,964 KB
testcase_04 AC 202 ms
83,288 KB
testcase_05 WA -
testcase_06 AC 211 ms
83,124 KB
testcase_07 AC 201 ms
82,888 KB
testcase_08 AC 200 ms
83,236 KB
testcase_09 AC 203 ms
82,012 KB
testcase_10 AC 61 ms
70,056 KB
testcase_11 AC 104 ms
81,396 KB
testcase_12 AC 177 ms
83,860 KB
testcase_13 AC 203 ms
83,260 KB
testcase_14 AC 203 ms
83,504 KB
testcase_15 AC 79 ms
76,724 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 208 ms
84,180 KB
testcase_20 AC 204 ms
83,140 KB
testcase_21 AC 201 ms
83,052 KB
testcase_22 WA -
testcase_23 AC 204 ms
82,700 KB
testcase_24 AC 223 ms
86,140 KB
testcase_25 AC 203 ms
82,164 KB
testcase_26 AC 205 ms
83,376 KB
testcase_27 AC 204 ms
83,680 KB
testcase_28 AC 203 ms
82,592 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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<=470:
    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)
0