163172025-04-28 15:59:14zsomborXorcpp17Wrong answer 0/10037ms2020 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 (ll 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/51ms316 KiB
7Wrong answer0/52ms376 KiB
8Wrong answer0/53ms316 KiB
9Wrong answer0/54ms316 KiB
10Wrong answer0/54ms476 KiB
11Wrong answer0/58ms564 KiB
12Wrong answer0/58ms580 KiB
13Wrong answer0/514ms1044 KiB
14Wrong answer0/623ms1188 KiB
15Wrong answer0/629ms1448 KiB
16Wrong answer0/637ms1804 KiB
17Wrong answer0/637ms1972 KiB
18Wrong answer0/74ms576 KiB
19Wrong answer0/737ms1800 KiB
20Wrong answer0/737ms2020 KiB