結果
| 問題 | No.3680 セグメント釣り |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-09-06 16:06:45 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 814 bytes |
| 記録 | |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 52,048 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-06 16:06:52 |
| 合計ジャッジ時間 | 4,577 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 WA * 3 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3680.cc: No.3680 繧サ繧ー繝。繝ウ繝磯・繧・- yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
/* typedef */
using ll = long long;
/* global variables */
/* subroutines */
/* main */
int main() {
int tn;
scanf("%d", &tn);
while (tn--) {
ll sx, sy, tx, ty;
scanf("%lld%lld%lld%lld", &sx, &sy, &tx, &ty);
ll ux = (sy < 64) ? (sx >> sy) : 0, uy = sy;
ll vx = (ty < 64) ? (tx >> ty) : 0, vy = ty;
ll d = 0;
if (uy > vy) d = uy - vy, vx >>= d, vy = uy;
if (uy < vy) d = vy - uy, ux >>= d, uy = vy;
ll mind = d + abs(ux - vx);
while (ux != vx) {
d += 2;
ux >>= 1, vx >>= 1;
mind = min(mind, d + abs(ux - vx));
}
printf("%lld\n", mind);
}
return 0;
}
tnakao0123