結果

問題 No.513 宝探し2
ユーザー c-yanc-yan
提出日時 2020-11-25 07:29:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 24,444 KB
平均クエリ数 49.50
最終ジャッジ日時 2023-09-24 07:17:11
合計ジャッジ時間 3,228 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
23,784 KB
testcase_06 WA -
testcase_07 AC 40 ms
23,808 KB
testcase_08 AC 41 ms
23,992 KB
testcase_09 AC 40 ms
23,888 KB
testcase_10 AC 41 ms
23,968 KB
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

cache = {}
def query(x, y):
    if (x, y) in cache:
        return cache[x, y]
    print(x, y)
    result = int(input())
    cache[x, y] = result
    if result == 0:
        exit()
    return result

l = 0
r = 100000
while r - l >= 3:
    c1 = (l * 2 + r) // 3
    c2 = (l + r * 2) // 3
    if query(c1, 0) > query(c2, 0):
        l = c1
    else:
        r = c2

m = query(l, 0)
i = l
for j in range(l + 1, r + 1):
    if query(j, 0) >= m:
        continue
    m = query(j, 0)
AX = m

AY = query(AX, 0)
query(AX, AY)
0