結果

問題 No.594 壊れた宝物発見機
ユーザー mkawa2mkawa2
提出日時 2020-01-05 21:18:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 804 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 44,068 KB
最終ジャッジ日時 2023-09-23 19:24:16
合計ジャッジ時間 7,485 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
sys.setrecursionlimit(10 ** 6)
def II(): return int(sys.stdin.readline())

def main():
    memo={}
    def question(i,a):
        if (i,a) in memo:return memo[(i,a)]
        xyz=[0,0,0]
        xyz[i]=a
        print("?",end=" ")
        print(*xyz)
        memo[(i,a)]=res=II()
        return res

    ans=[0]*3
    for i in range(3):
        l=-101
        r=101
        while l+2<r:
            cl=(2*l+r)//3
            cr=(l+2*r)//3
            dl=question(i,cl)
            dr=question(i,cr)
            if dl<dr:r=cr
            else:l=cl
        c=(l+r)//2
        dl=question(i,l)
        dc=question(i,c)
        dr=question(i,r)
        mn=min(dl,dc,dr)
        if mn==dl:ans[i]=l
        if mn==dc:ans[i]=c
        if mn==dr:ans[i]=r
    print("!",end=" ")
    print(*ans)

main()
0