結果

問題 No.594 壊れた宝物発見機
コンテスト
ユーザー mkawa2
提出日時 2020-01-05 21:26:20
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 1,512 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 567 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 42,232 KB
最終ジャッジ日時 2026-03-31 20:46:39
合計ジャッジ時間 7,209 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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