結果
| 問題 | No.3680 セグメント釣り |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-05 15:20:29 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 261 ms / 2,000 ms |
| + 458µs | |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 2,244 ms |
| コンパイル使用メモリ | 330,564 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-05 15:20:46 |
| 合計ジャッジ時間 | 8,458 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void){
int t;
cin>>t;
while(t--){
long long sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
if(max(sy,ty)>=61){
cout<<abs(sy-ty)<<endl;
continue;
}
long long ans=1e18;
for(long long i=max(sy,ty);i<61;i++){
ans=min(abs(sy-i)+abs(ty-i)+abs((tx/(1LL<<i))-(sx/(1LL<<i))),ans);
}
cout<<ans<<endl;
}
return 0;
}