結果

問題 No.3093 Please GCD
ユーザー tassei903tassei903
提出日時 2022-04-01 21:42:47
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,358 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 87,340 KB
平均クエリ数 505.00
最終ジャッジ日時 2024-04-30 13:31:47
合計ジャッジ時間 8,021 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 WA -
testcase_04 AC 119 ms
82,720 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 116 ms
81,840 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 152 ms
82,744 KB
testcase_13 AC 143 ms
82,696 KB
testcase_14 AC 121 ms
82,056 KB
testcase_15 RE -
testcase_16 AC 190 ms
82,788 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 204 ms
82,688 KB
testcase_20 AC 200 ms
82,944 KB
testcase_21 AC 147 ms
82,520 KB
testcase_22 WA -
testcase_23 AC 128 ms
83,192 KB
testcase_24 AC 112 ms
82,240 KB
testcase_25 AC 154 ms
83,148 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 112 ms
82,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

def divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def is_prime(n):
    if n==1:
        return False
    if len(divisors(n))==1:
        return True
    else:
        return False


p = []
pmax = 10**4
a = [-1]*(pmax+1)
for i in range(2,pmax+1):
    if a[i]==-1:
        p.append(i)
        for j in range(i,pmax+1,i):
            a[j] = i
plen = len(p)

def f(x):
    for i in p:
        if x==i:
            return 1
        if x%i==0:
            return 0
    return 1

def fastfact(x):
    r = []
    while x > 1:
        p = a[x]
        c = 0
        while a[x]==p:
            x//=p
            c += 1
        r.append((p, c))
    return r
n = ni()
ans = 1
m = 600
for i in range(m):
    print("?",p[i],flush=True)
    s = ni()
    ans *= s
print("!", ans)
0