結果

問題 No.594 壊れた宝物発見機
ユーザー mkawa2mkawa2
提出日時 2020-01-05 21:27:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 728 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 24,312 KB
平均クエリ数 52.85
最終ジャッジ日時 2023-09-23 19:24:20
合計ジャッジ時間 4,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
23,616 KB
testcase_01 AC 128 ms
23,688 KB
testcase_02 AC 128 ms
23,588 KB
testcase_03 AC 127 ms
24,012 KB
testcase_04 AC 126 ms
23,556 KB
testcase_05 AC 127 ms
24,240 KB
testcase_06 AC 125 ms
24,228 KB
testcase_07 AC 126 ms
24,036 KB
testcase_08 AC 126 ms
23,808 KB
testcase_09 AC 128 ms
23,808 KB
testcase_10 AC 130 ms
23,784 KB
testcase_11 AC 128 ms
24,012 KB
testcase_12 AC 126 ms
23,808 KB
testcase_13 AC 128 ms
23,364 KB
testcase_14 AC 126 ms
24,312 KB
testcase_15 AC 127 ms
23,688 KB
testcase_16 AC 127 ms
23,440 KB
testcase_17 AC 130 ms
23,532 KB
testcase_18 AC 133 ms
23,412 KB
testcase_19 AC 130 ms
23,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    def question(i,a):
        if memo[a]!=-1:return memo[a]
        xyz=[0,0,0]
        xyz[i]=a
        print("?",end=" ")
        print(*xyz)
        memo[a]=res=int(input())
        return res

    ans=[0]*3
    for i in range(3):
        memo = [-1]*205
        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