結果

問題 No.2357 Guess the Function
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-23 23:18:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 561 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 24,396 KB
平均クエリ数 5.45
最終ジャッジ日時 2023-09-13 18:26:18
合計ジャッジ時間 1,477 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 RE -
testcase_04 AC 39 ms
24,228 KB
testcase_05 AC 39 ms
23,460 KB
testcase_06 AC 39 ms
23,544 KB
testcase_07 AC 38 ms
23,632 KB
testcase_08 WA -
testcase_09 RE -
testcase_10 AC 40 ms
23,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_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]


print('? 1', flush=True)
i = int(input())
if i == 0:
    print('! 0 1', flush=True)
A = i-1
print('? 100', flush=True)
j = int(input())
P = make_divisors(100+A-j)
for B in P:
    if j < B and (1+A) % B == i and (100+A) % B == j:
        print('! {} {}'.format(A, B))
0