結果

問題 No.594 壊れた宝物発見機
ユーザー cleanttedcleantted
提出日時 2017-11-10 23:24:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 2,186 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 44,000 KB
最終ジャッジ日時 2023-09-23 15:43:36
合計ジャッジ時間 6,535 ms
ジャッジサーバーID
(参考情報)
judge13 / 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
ans = [0,0,0]

for i in range(3):
    up = 100
    down = -100
    
    if i == 0:
        while up != down:
            print("?", up, 0, 0)
            sys.stdout.flush()
            while 1:
                try:         
                    d1 = int(input())
                    break
                except EOFError:
                    continue
                
            
            print("?", down, 0, 0)
            sys.stdout.flush()
            while 1:
                try:         
                    d2 = int(input())
                    break
                except EOFError:
                    continue
            
            if d1 <= d2:
                down = (up + down)//2
            else:
                up = (up + down)//2
    elif i == 1:
        while up != down:
            print("?", 0, up, 0)
            sys.stdout.flush()
            while 1:
                try:         
                    d1 = int(input())
                    break
                except EOFError:
                    continue
                
            print("?", 0, down, 0)
            sys.stdout.flush()
            while 1:
                try:         
                    d2 = int(input())
                    break
                except EOFError:
                    continue
            
            if d1 <= d2:
                down = (up + down)//2
            else:
                up = (up + down)//2
    elif i == 2:
        while up != down:
            print("?", 0, 0, up)
            sys.stdout.flush()
            while 1:
                try:         
                    d1 = int(input())
                    break
                except EOFError:
                    continue
                
            print("?", 0, 0, down)
            sys.stdout.flush()
            while 1:
                try:         
                    d2 = int(input())
                    break
                except EOFError:
                    continue
            if d1 <= d2:
                down = (up + down)//2
            else:
                up = (up + down)//2
                
    ans[i] = up

print("!", ans[0], ans[1], ans[2])
sys.stdout.flush()
0