結果

問題 No.594 壊れた宝物発見機
ユーザー rlangevinrlangevin
提出日時 2024-03-12 07:54:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,298 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 71,592 KB
平均クエリ数 189.00
最終ジャッジ日時 2024-03-12 07:55:06
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

import sys

lx, rx = -150, 150
ly, ry = -150, 150
lz, rz = -150, 150
for _ in range(30):
    c1, c2 = (lx * 2 + rx)//3, (lx + rx * 2)//3
    print("? {} {} {}".format(c1, ly, lz))
    sys.stdout.flush()
    f1 = int(input())
    print("? {} {} {}".format(c2, ly, lz))
    sys.stdout.flush()
    f2 = int(input())
    if f1 <= f2:
        lx = c2
    else:
        rx = c1
        
for _ in range(30):
    c1, c2 = (ly * 2 + ry)//3, (ly + ry * 2)//3
    print("? {} {} {}".format(lx, c1, lz))
    sys.stdout.flush()
    f1 = int(input())
    print("? {} {} {}".format(lx, c2, lz))
    sys.stdout.flush()
    f2 = int(input())
    if f1 <= f2:
        ly = c2
    else:
        ry = c1
    
for _ in range(30):
    c1, c2 = (lz * 2 + rz)//3, (lz + rz * 2)//3
    print("? {} {} {}".format(lx, ly, c1))
    sys.stdout.flush()
    f1 = int(input())
    print("? {} {} {}".format(lx, ly, c2))
    sys.stdout.flush()
    f2 = int(input())
    if f1 <= f2:
        lz = c2
    else:
        rz = c1
        
ans = []
minv = 10 ** 18
for x in range(lx, rx + 1):
    for y in range(ly, ry + 1):
        for z in range(lz, rz + 1):
            print("? {} {} {}".format(x, y, z))
            d = int(input())
            if d <= minv:
                minv = d
                ans = ["!", x, y, z]
print(*ans)
0