結果

問題 No.3680 セグメント釣り
コンテスト
ユーザー twins_fuyu
提出日時 2026-09-06 16:55:55
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 2,925 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,223 ms
コンパイル使用メモリ 202,684 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-06 16:56:03
合計ジャッジ時間 6,107 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cstdint>
#include <queue>
#include <tuple>
#include <cassert>
#include <atcoder/all>
#include <iomanip>
#include <cmath>
#include <cstring>
using namespace std;
using ll = int64_t; using ull = uint64_t;
using vl = vector<ll>; using vvl = vector<vl>;using vvvl = vector<vvl>;
using vb = vector<bool>; using vvb = vector<vb>;using vvvb = vector<vvb>;
using vs = vector<string>; using vvs=vector<vector<string>>;
using pl = pair<ll,ll>; using vpl = vector<pl>;using vvpl = vector<vpl>;
using tl = tuple<ll,ll,ll>; using vtl = vector<tl>;using vvtl = vector<vector<tl>>;
using sl = set<ll>; using vsl = vector<sl>; using vvsl = vector<vsl>;
using ml = map<ll,ll>; using vml = vector<ml>; using vvml = vector<vml>;
using usl = unordered_set<ll>; using vusl = vector<usl>; using vvusl = vector<vusl>;
using uml = unordered_map<ll,ll>; using vuml = vector<uml>; using vvuml = vector<vuml>;
using mint = atcoder::modint998244353; 
using vm = vector<mint>; using vvm = vector<vector<mint>>; using vvvm = vector<vvm>;
#define rep1(a) for (ll _ = 0; _ < ll(a); ++_)
#define rep2(i, a) for (ll i = 0; i < ll(a); ++i)
#define rep3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define rrep1(a) for (ll i = (a)-1; i >= ll(0); --i)
#define rrep2(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define rrep3(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload3(a, b, c, d, ...) d
#define rep(...) overload3(__VA_ARGS__, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) overload3(__VA_ARGS__, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define in(i,vec) for (auto i:(vec))
#define siz(a) ll(a.size())
void YesNo(bool a){cout<<(a?"Yes\n":"No\n");}
template<class T> using pqueue = priority_queue<T, vector<T>>;//大きい順
template<class T> using pqueue_g = priority_queue<T, vector<T>, greater<T>>;//小さい順
template<class T> bool chmin(T& x, T y){if(x>y){x=y;return true;}else return false;}
template<class T> bool chmax(T& x, T y){if(x<y){x=y;return true;}else return false;}
template<class T> void sor(vector<T>& v){sort(v.begin(),v.end());}
template<class T> void sor_g(vector<T>& v){sort(v.begin(),v.end(),greater<>());}
template<class T> void vin(vector<T>& v){size_t N = v.size();for(size_t i=0;i<N;++i)cin>>v[i];}
template<class T> void vvin(vector<vector<T>>& v){size_t N=v.size(),M=v[0].size();for(size_t i=0;i<N;++i)for(size_t j=0;j<M;++j)cin>>v[i][j];}
pair<int,int> d1{1,0},d2{0,1},d3{-1,0},d4{0,-1},d5{1,1},d6{-1,1},d7{1,-1},d8{-1,-1};
ll inf = 1e18;
int infi = 1e9;



int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll T; cin>>T;
    rep(T){
        ll sx,sy,tx,ty; cin>>sx>>sy>>tx>>ty;
        ll dx = abs(sy-ty);
        ll shift = min<ll>(max(sy,ty),62);
        ll dy = abs((sx>>shift)-(tx>>shift));
        cout<<dx+dy<<"\n";
    }
}
0