結果

問題 No.3680 セグメント釣り
コンテスト
ユーザー iastm
提出日時 2026-09-06 21:45:35
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 380 ms / 2,000 ms
+ 571µs
コード長 408 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 644 ms
コンパイル使用メモリ 95,700 KB
実行使用メモリ 87,084 KB
最終ジャッジ日時 2026-09-06 21:45:52
合計ジャッジ時間 7,461 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

for _ in range(int(input())):
    sx, sy, tx, ty = (int(x) for x in input().split())
    if sy < ty:
        sx, sy, tx, ty = tx, ty, sx, sy
    if sy >= 60:
        print(sy - ty)
        continue
    result = float("inf")
    for y in range(sy, 61):
        width = 1 << y
        bsx = sx // width
        btx = tx // width
        result = min(result, abs(bsx - btx) + y * 2 - sy - ty)
    print(result)
0