結果

問題 No.3093 Please GCD
ユーザー ikomaikoma
提出日時 2022-04-01 23:03:43
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 515 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 94,400 KB
平均クエリ数 596.03
最終ジャッジ日時 2024-04-30 15:37:01
合計ジャッジ時間 9,728 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
69,720 KB
testcase_01 RE -
testcase_02 AC 82 ms
76,748 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 175 ms
93,716 KB
testcase_09 RE -
testcase_10 AC 64 ms
68,804 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 77 ms
75,828 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 AC 175 ms
94,228 KB
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 RE -
testcase_27 WA -
testcase_28 WA -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def eratosthenes(n):
    res=[0]*(n+1)
    prime=set([])
    for i in range(2,n+1):
        if not res[i]:
            prime.add(i)
            for j in range(i,n+1,i):
                res[j]=1
    return sorted(list(prime))
N=int(input())
prime = eratosthenes(N)
ans = 1
cnt=0
for p in prime:
    y=1
    while True:
        cnt+=1
        y*=p
        print(f"? {y}", flush=True)
        s=int(input())
        if s==1:break
        if s==y:continue
        ans *= y//p
        break
print(f"! {ans}", flush=True)
0