結果

問題 No.594 壊れた宝物発見機
ユーザー mkawa2mkawa2
提出日時 2020-01-05 21:26:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,512 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 65,260 KB
最終ジャッジ日時 2023-09-23 19:24:31
合計ジャッジ時間 6,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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)
from itertools import *
from bisect import *
# from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np

int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]

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=II()
        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