結果
問題 |
No.2962 Sum Bomb Bomber
|
ユーザー |
![]() |
提出日時 | 2024-11-30 00:53:48 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 840 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 83,176 KB |
平均クエリ数 | 86.72 |
最終ジャッジ日時 | 2024-11-30 00:54:04 |
合計ジャッジ時間 | 14,766 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | RE * 64 |
ソースコード
from functools import lru_cache @lru_cache(maxsize=10000) def calc(X): x,y = X print(1,x,y) return int(input()) N = int(input()) lb = - 10 ** 8 ub = 10 ** 8 + 1 cnt = 0 while cnt < 50 and ub - lb > 3: mid1 = 2 * lb // 3 + ub // 3 mid2 = lb // 3 + 2 * ub // 3 if calc((mid1,0)) <= calc((mid2,0)): ub = mid2 else: lb = mid1 cnt += 1 xlb,xub = lb,ub lb = - 10 ** 8 ub = 10 ** 8 + 1 cnt = 0 print() while cnt < 50 and ub - lb > 3: mid1 = 2 * lb // 3 + ub // 3 mid2 = lb // 3 + 2 * ub // 3 if calc((0,mid1)) < calc((0,mid2)): ub = mid2 else: lb = mid1 cnt += 1 ylb,yub = lb,ub tmp = 10 ** 11 ans = [] for i in range(xlb,xub): for j in range(ylb,yub): t = calc((i,j)) if t < tmp: tmp = t ans = (i,j) print(2,*ans)