結果

問題 No.2962 Sum Bomb Bomber
コンテスト
ユーザー ntuda
提出日時 2024-11-30 00:57:24
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 409 ms / 2,000 ms
+ 999µs
コード長 832 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 254 ms
コンパイル使用メモリ 64,208 KB
実行使用メモリ 54,372 KB
平均クエリ数 179.92
最終ジャッジ日時 2026-10-31 23:54:37
合計ジャッジ時間 10,471 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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
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)


0