結果

問題 No.8093 Please GCD
ユーザー rin204
提出日時 2022-04-01 21:49:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 617 bytes
コンパイル時間 631 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 84,056 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-11-20 08:55:05
合計ジャッジ時間 8,239 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 RE * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 10010
isprime = [True] * N
isprime[0] = isprime[1] = False
for i in range(2, int(N ** 0.5 + 1)):
    if not isprime[i]:
        continue
    for j in range(i * i, N, i):
        isprime[j] = False

n = int(input())
primes = []
for i in range(2, n + 1):
    if isprime[i]:
        primes.append(i)

l = len(primes)
ans = 1
for i in range(0, l, 3):
    y = 1
    for j in range(i, i + 3):
        if j == l:
            break
        z = primes[j]
        while z * primes[j] <= n:
            z *= primes[j]
        y *= z
    print("?", y, flush=True)
    ans *= int(input())
print("!", ans)
            
        
0