結果

問題 No.594 壊れた宝物発見機
ユーザー cleanttedcleantted
提出日時 2017-11-11 00:14:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,402 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 24,752 KB
平均クエリ数 156.20
最終ジャッジ日時 2023-09-23 15:01:18
合計ジャッジ時間 4,262 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 115 ms
24,088 KB
testcase_02 RE -
testcase_03 AC 117 ms
24,244 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 119 ms
24,264 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 115 ms
24,600 KB
testcase_16 RE -
testcase_17 AC 120 ms
23,624 KB
testcase_18 RE -
testcase_19 AC 113 ms
23,880 KB
権限があれば一括ダウンロードができます

ソースコード

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()
            d1 = int(input())
            sys.stdout.flush()
            print("?", down, 0, 0)
            sys.stdout.flush()
            d2 = int(input())
            sys.stdout.flush()
            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()
            d1 = int(input())
            sys.stdout.flush()
            print("?", 0, down, 0)
            sys.stdout.flush()
            d2 = int(input())
            sys.stdout.flush()
            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()
            d1 = int(input())
            sys.stdout.flush()
            print("?", 0, 0, down)
            sys.stdout.flush()
            d2 = int(input())
            sys.stdout.flush()
            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