結果
問題 | No.594 壊れた宝物発見機 |
ユーザー |
|
提出日時 | 2018-07-29 20:43:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 1,073 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,608 KB |
平均クエリ数 | 72.90 |
最終ジャッジ日時 | 2024-07-16 15:58:27 |
合計ジャッジ時間 | 4,254 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
from sys import stdin, stdoutinput = lambda: stdin.readline().rstrip()write = stdout.writedef main():x = y = z = 0for s in ('x', 'y', 'z'):d = dist(s, x, y, z)if s == 'x':x = delif s == 'y':y = delse:z = dprint('!', x, y, z)stdout.flush()def dist(axis, x, y, z):point = -100max_ = 150dmin = float('inf')while point < max_:xi = point if axis == 'x' else xyi = point if axis == 'y' else yzi = point if axis == 'z' else zprint('?', xi, yi, zi)stdout.flush()d = int(input())if d > dmin:breakdmin = dpoint += 10dmin = dwhile 1:point -= 1xi = point if axis == 'x' else xyi = point if axis == 'y' else yzi = point if axis == 'z' else zprint('?', xi, yi, zi)stdout.flush()d = int(input())if d < dmin:dmin = delse:breakreturn point + 1main()