結果

問題 No.2357 Guess the Function
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-23 21:48:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 1,000 ms
コード長 539 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 87,620 KB
平均クエリ数 2.91
最終ジャッジ日時 2023-09-13 16:47:52
合計ジャッジ時間 2,270 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
87,620 KB
testcase_01 AC 95 ms
87,144 KB
testcase_02 AC 94 ms
87,076 KB
testcase_03 AC 94 ms
86,820 KB
testcase_04 AC 96 ms
87,452 KB
testcase_05 AC 95 ms
86,916 KB
testcase_06 AC 96 ms
87,520 KB
testcase_07 AC 95 ms
87,404 KB
testcase_08 AC 95 ms
87,292 KB
testcase_09 AC 95 ms
86,800 KB
testcase_10 AC 94 ms
87,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

100+A % B = C

1回目も有効活用しないとだめ

(100+A) % B = C
(100+A-C-1) % B = B-1

で、Bがわかる
AはB未満なので、一意

"""

import sys
print ("?",100,flush=True)

c = int(input())

if c == 99:
    print ("!",99,100)
    sys.exit()

print ("?",100-c-1,flush=True)
d = int(input())

b = d + 1

for a in range(1,b):
    if (100+a) % b == c:
        print ("!",a,b)
        sys.exit()

a = 0

for b in range(1,101):
    if (a+100) % b == c and (100+a-c-1) % b == d:
        print ("!",a,b)
        sys.exit()
0