結果

問題 No.594 壊れた宝物発見機
ユーザー Akijin_007Akijin_007
提出日時 2023-10-06 14:02:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,344 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 87,980 KB
平均クエリ数 83.00
最終ジャッジ日時 2023-10-06 14:02:51
合計ジャッジ時間 5,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

import sys

x = 0
y = 0
z = 0

def ques(x, y, z):
    print(f"? {x} {y} {z}")
    sys.stdout.flush()
    D = int(input())
    return D

min1 = -10
max1 = 10

while max1 - min1 >= 3:
    h1 = min1 + (max1 - min1) // 3
    h2 = max1 - (max1 - min1) // 3
    d1 = ques(h1, y, z)
    d2 = ques(h2, y, z)

    if d1 <= d2:
        max1 = h2
    else:
        min1 = h1
    print(min1, max1)

ansx = 0
dx = 1 << 32
for i in range(min1, max1+1):
    d = ques(i, y, z)
    if d < dx:
        dx = d
        ansx = i

x = ansx


min1 = -150
max1 = 150

while max1 - min1 >= 3:
    h1 = min1 + (max1 - min1) // 3
    h2 = max1 - (max1 - min1) // 3
    d1 = ques(x, h1, z)
    d2 = ques(x, h2, z)

    if d1 <= d2:
        max1 = h2
    else:
        min1 = h1

ansx = 0
dx = 1 << 32
for i in range(min1, max1+1):
    d = ques(x, i, z)
    if d < dx:
        dx = d
        ansx = i

y = ansx

min1 = -150
max1 = 150

while max1 - min1 >= 3:
    h1 = min1 + (max1 - min1) // 3
    h2 = max1 - (max1 - min1) // 3
    d1 = ques(x, y, h1)
    d2 = ques(x, y, h2)

    if d1 <= d2:
        max1 = h2
    else:
        min1 = h1

ansx = 0
dx = 1 << 32
for i in range(min1, max1+1):
    d = ques(x, y, i)
    if d < dx:
        dx = d
        ansx = i

z = ansx

print(f"! {x} {y} {z}")
0