Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"Vlad found two positive numbers a and b ( a,b>0 ). He discovered that a oplus b = frac{a + b}{2} , where oplus means the bitwise exclusive OR , and division is performed without rounding.. Since it is easier to remember one number than two, Vlad remembered only a oplus b , let's denote this number as x . Help him find any suitable a and b or tell him that they do not exist. The first line of the input data contains the single integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. Each test case is described by a single integer x ( 1 <= x <= 2^{29} ) -- the number that Vlad remembered. Output t lines, each of which is the answer to the corresponding test case. As the answer, output a and b ( 0 < a,b <= 2^{32} ), such that x = a oplus b = frac{a + b}{2} . If there are several answers, output any of them. If there are no matching pairs, output -1. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
190879546 |
chrisTris |
E |
Jan. 27, 2023, 5:03 p.m. |
OK |
C# 10 |
TESTS |
12 |
46 |
1843200 |
|
|
190874938 |
doublethinker |
E |
Jan. 27, 2023, 4:47 p.m. |
OK |
C# 10 |
TESTS |
12 |
108 |
3379200 |
|
|
190920326 |
zhoujunl |
E |
Jan. 28, 2023, 3:38 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
12 |
156 |
1433600 |
|
|
190912506 |
renatxat |
E |
Jan. 28, 2023, 12:22 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
12 |
779 |
20992000 |
|
|
190911946 |
NenadDapic |
E |
Jan. 28, 2023, 12:10 a.m. |
OK |
FPC |
TESTS |
12 |
46 |
0 |
|
|
190930172 |
wyzmt |
E |
Jan. 28, 2023, 5:50 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190928682 |
y_kx_b |
E |
Jan. 28, 2023, 5:34 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190927717 |
_varun.11 |
E |
Jan. 28, 2023, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190927520 |
Inori |
E |
Jan. 28, 2023, 5:21 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190926302 |
anisha1112 |
E |
Jan. 28, 2023, 5:08 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190925921 |
Gastan |
E |
Jan. 28, 2023, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190924851 |
2018ljw |
E |
Jan. 28, 2023, 4:50 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190923486 |
nguyennhat.110120 |
E |
Jan. 28, 2023, 4:32 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190922943 |
yeVegetable |
E |
Jan. 28, 2023, 4:24 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
190922074 |
Jasoncwx |
E |
Jan. 28, 2023, 4:12 a.m. |
OK |
GNU C++14 |
TESTS |
12 |
15 |
0 |
|
|
remove filters
Back to search problems