結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
69,520 KB
testcase_01 AC 64 ms
74,744 KB
testcase_02 AC 77 ms
77,400 KB
testcase_03 WA -
testcase_04 AC 203 ms
82,628 KB
testcase_05 WA -
testcase_06 AC 191 ms
82,568 KB
testcase_07 WA -
testcase_08 AC 198 ms
82,664 KB
testcase_09 AC 194 ms
82,216 KB
testcase_10 AC 60 ms
68,740 KB
testcase_11 AC 102 ms
80,772 KB
testcase_12 AC 191 ms
82,856 KB
testcase_13 AC 203 ms
83,824 KB
testcase_14 AC 198 ms
81,872 KB
testcase_15 AC 77 ms
76,712 KB
testcase_16 AC 193 ms
82,896 KB
testcase_17 AC 194 ms
83,648 KB
testcase_18 AC 192 ms
82,684 KB
testcase_19 AC 201 ms
81,812 KB
testcase_20 AC 218 ms
82,676 KB
testcase_21 AC 198 ms
82,688 KB
testcase_22 AC 369 ms
93,292 KB
testcase_23 AC 194 ms
83,560 KB
testcase_24 AC 191 ms
82,932 KB
testcase_25 AC 195 ms
84,172 KB
testcase_26 WA -
testcase_27 AC 193 ms
83,068 KB
testcase_28 AC 371 ms
93,764 KB
testcase_29 AC 203 ms
83,120 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<=420:
    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