結果
| 問題 | No.3680 セグメント釣り |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-10-07 02:31:44 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 604 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 82,940 KB |
| 実行使用メモリ | 85,968 KB |
| 最終ジャッジ日時 | 2026-10-07 02:31:57 |
| 合計ジャッジ時間 | 4,994 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 12 |
ソースコード
import sys
input = sys.stdin.readline
def calc(sx,sy):
if sy>=70:
haba=10**20
else:
haba=min(1<<sy,10**20)
left=sx//haba*haba
right=left+haba
return haba,left,right
T=int(input())
for tests in range(T):
sx,sy,tx,ty=list(map(int,input().split()))
ANS=0
if ty>sy:
ANS+=ty-sy
sy=ty
plus=1<<63
for i in range(10**9):
haba,left,right=calc(sx,sy+i)
haba2,left2,right2=calc(tx,ty)
plus=min(plus,i*2+(left2-left)//haba)
if left<=left2<=right:
break
print(ANS+plus)
titia