結果
問題 | No.2962 Sum Bomb Bomber |
ユーザー |
|
提出日時 | 2024-11-16 16:16:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 169 ms / 2,000 ms |
コード長 | 1,000 bytes |
コンパイル時間 | 615 ms |
コンパイル使用メモリ | 82,264 KB |
実行使用メモリ | 70,368 KB |
平均クエリ数 | 189.00 |
最終ジャッジ日時 | 2024-11-16 16:17:45 |
合計ジャッジ時間 | 13,059 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 64 |
ソースコード
def fx(x): print(1, x, 0, flush=True) d = int(input()) return d def fy(y): print(1, 0, y, flush=True) d = int(input()) return d import sys input = sys.stdin.readline N = int(input()) INF = 10**8+1 left = -INF right = INF limit = 3 while left + limit < right: c1 = left + (right-left)//3 c2 = right - (right-left)//3 #print(left, right, c1, c2) #更新を行う if fx(c1) < fx(c2): right = c2 else: left = c1 tmp_x = fx(left) ans_x = left for x in range(left+1, right+1): ret = fx(x) if tmp_x>ret: tmp_x = ret ans_x = x left = -INF right = INF limit = 3 while left + limit < right: c1 = left + (right-left)//3 c2 = right - (right-left)//3 #更新を行う if fy(c1) < fy(c2): right = c2 else: left = c1 tmp_y = fy(left) ans_y = left for y in range(left+1, right+1): ret = fy(y) if tmp_y>ret: tmp_y = ret ans_y = y print(2, ans_x, ans_y, flush=True)