163162025-04-28 15:48:45zsomborXorcpp17Wrong answer 0/10037ms2000 KiB
#include <iostream>
using namespace std;
using ll = long long;

void solve() {
	ll l, r, a = 0, b = 0, c = 0, p = 0;
	cin >> l >> r;
	for (int i = 60; i >= 0; i--) {
		ll h = (1ll << i);
		if (!p) {
			if ((l & h) == (r & h)) {
				a += (l & h);
				b += (l & h);
				c += (l & h);
			}
			else {
				a += h;
				p = 1;
			}
		}
		else {
			if (l & h) {
				a += r & h;
				b += h;
				c += h;
			}
			else {
				b += h;
				c += h - 1;
				break;
			}
		}
	}
	if (b == c) b++;
	cout << c << " " << b << " " << a << "\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) solve();
}
SubtaskSumTestVerdictTimeMemory
base0/100
1Accepted0/01ms316 KiB
2Wrong answer0/04ms564 KiB
3Wrong answer0/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/51ms316 KiB
6Wrong answer0/51ms508 KiB
7Wrong answer0/52ms316 KiB
8Wrong answer0/53ms348 KiB
9Wrong answer0/54ms384 KiB
10Wrong answer0/54ms564 KiB
11Wrong answer0/58ms644 KiB
12Wrong answer0/58ms600 KiB
13Wrong answer0/516ms1024 KiB
14Wrong answer0/623ms1332 KiB
15Wrong answer0/629ms1556 KiB
16Wrong answer0/637ms1996 KiB
17Wrong answer0/637ms1940 KiB
18Wrong answer0/74ms564 KiB
19Wrong answer0/737ms2000 KiB
20Wrong answer0/737ms1848 KiB