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'You are given integers a , b , r . Find the smallest value of |({a oplus x}) - ({b oplus x})| among all 0 <= q x <= q r . oplus is the operation of bitwise XOR, and |y| is absolute value of y . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case contains integers a , b , r ( 0 <= a, b, r <= 10^{18} ). For each test case, output a single number -- the smallest possible value. In the first test, when r = 0 , then x is definitely equal to 0 , so the answer is |{4 oplus 0} - {6 oplus 0}| = |4 - 6| = 2 . In the second test: Therefore, the answer is 1 . In the third test, the minimum is achieved when x = 1 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
244137539 |
avtoruxadze |
C |
Jan. 30, 2024, 4:26 p.m. |
OK |
C# 10 |
TESTS |
10 |
140 |
3276800 |
|
|
244134630 |
sadekprince09 |
C |
Jan. 30, 2024, 4:18 p.m. |
OK |
C# 8 |
TESTS |
10 |
233 |
3481600 |
|
|
244195229 |
lonely_log |
C |
Jan. 31, 2024, 3:24 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
14 |
62 |
0 |
|
|
244194104 |
raiShivansh9848 |
C |
Jan. 31, 2024, 3:09 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
13 |
389 |
0 |
|
|
244195309 |
lonely_log |
C |
Jan. 31, 2024, 3:25 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
14 |
62 |
0 |
|
|
244139154 |
Nishant_2728 |
C |
Jan. 30, 2024, 4:30 p.m. |
OK |
GNU C11 |
TESTS |
10 |
78 |
307200 |
|
|
244136134 |
noob_learnr |
C |
Jan. 30, 2024, 4:22 p.m. |
OK |
GNU C11 |
TESTS |
10 |
93 |
307200 |
|
|
244135334 |
Guanidine |
C |
Jan. 30, 2024, 4:20 p.m. |
OK |
GNU C11 |
TESTS |
10 |
93 |
307200 |
|
|
244134816 |
rohajrohit |
C |
Jan. 30, 2024, 4:19 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
244134353 |
HET03 |
C |
Jan. 30, 2024, 4:17 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
244138172 |
SNP011 |
C |
Jan. 30, 2024, 4:27 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
244139375 |
Sai_Nagesh |
C |
Jan. 30, 2024, 4:30 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
244153832 |
Mehedi_Hasan_21 |
C |
Jan. 30, 2024, 6:16 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
15 |
0 |
|
|
244155364 |
fractal |
C |
Jan. 30, 2024, 6:22 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
30 |
0 |
|
|
244155171 |
Tomori-Nao |
C |
Jan. 30, 2024, 6:21 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
30 |
0 |
|
|
244185911 |
mhmdshakerr |
C |
Jan. 31, 2024, 12:54 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
30 |
0 |
|
|
244163083 |
SzypkiBill |
C |
Jan. 30, 2024, 7:09 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
30 |
0 |
|
|
244160263 |
aman2oo4 |
C |
Jan. 30, 2024, 6:48 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
30 |
0 |
|
|
244190035 |
sqcnzlgvhy |
C |
Jan. 31, 2024, 2:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244189902 |
CMD_nkdx |
C |
Jan. 31, 2024, 2:09 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244189530 |
1528344561 |
C |
Jan. 31, 2024, 2:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244188293 |
xiehongxin |
C |
Jan. 31, 2024, 1:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244186323 |
hydroshiba |
C |
Jan. 31, 2024, 1:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244184904 |
Pengzt |
C |
Jan. 31, 2024, 12:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244176225 |
blitz2 |
C |
Jan. 30, 2024, 9:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244198788 |
supine |
C |
Jan. 31, 2024, 4:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
15 |
0 |
|
|
244190646 |
Owmicron |
C |
Jan. 31, 2024, 2:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244190555 |
SyaOtiLan |
C |
Jan. 31, 2024, 2:19 a.m. |
OK |
GNU C++17 (64) |
TESTS |
10 |
15 |
0 |
|
|
244204734 |
vogel-im-kafig |
C |
Jan. 31, 2024, 5:12 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244209451 |
TempBahy |
C |
Jan. 31, 2024, 5:57 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244206816 |
isolated_pawn_17 |
C |
Jan. 31, 2024, 5:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244206397 |
night.watchman |
C |
Jan. 31, 2024, 5:29 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244206252 |
NotShivam_382 |
C |
Jan. 31, 2024, 5:28 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244205417 |
CosmicPegasis |
C |
Jan. 31, 2024, 5:20 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244205131 |
A__S |
C |
Jan. 31, 2024, 5:16 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244204317 |
frissky9 |
C |
Jan. 31, 2024, 5:08 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244204084 |
acwin1 |
C |
Jan. 31, 2024, 5:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244203845 |
Jokesta |
C |
Jan. 31, 2024, 5:03 a.m. |
OK |
GNU C++20 (64) |
TESTS |
15 |
15 |
0 |
|
|
244188495 |
0x3F |
C |
Jan. 31, 2024, 1:46 a.m. |
OK |
Go |
TESTS |
10 |
46 |
819200 |
|
|
244138009 |
ajayg3059 |
C |
Jan. 30, 2024, 4:27 p.m. |
OK |
Go |
TESTS |
10 |
61 |
1024000 |
|
|
244174669 |
foolcoder |
C |
Jan. 30, 2024, 9:05 p.m. |
OK |
Java 21 |
TESTS |
10 |
218 |
0 |
|
|
244161399 |
v3n1v1c11v1c1 |
C |
Jan. 30, 2024, 6:56 p.m. |
OK |
Java 21 |
TESTS |
10 |
234 |
102400 |
|
|
244173034 |
foolcoder |
C |
Jan. 30, 2024, 8:44 p.m. |
OK |
Java 21 |
TESTS |
10 |
249 |
0 |
|
|
244139878 |
d2s2 |
C |
Jan. 30, 2024, 4:32 p.m. |
OK |
Java 21 |
TESTS |
10 |
264 |
204800 |
|
|
244161751 |
v3n1v1c11v1c1 |
C |
Jan. 30, 2024, 6:59 p.m. |
OK |
Java 21 |
TESTS |
10 |
265 |
0 |
|
|
244178952 |
shaili17 |
C |
Jan. 30, 2024, 10:13 p.m. |
OK |
Java 21 |
TESTS |
10 |
280 |
0 |
|
|
244139765 |
Mamimi |
C |
Jan. 30, 2024, 4:31 p.m. |
OK |
Java 21 |
TESTS |
10 |
280 |
0 |
|
|
244137133 |
FunkyDepression |
C |
Jan. 30, 2024, 4:25 p.m. |
OK |
Java 21 |
TESTS |
10 |
280 |
0 |
|
|
244187768 |
Zhanzhe_Lee |
C |
Jan. 31, 2024, 1:33 a.m. |
OK |
Java 21 |
TESTS |
10 |
280 |
307200 |
|
|
244157036 |
umcleji |
C |
Jan. 30, 2024, 6:29 p.m. |
OK |
Java 21 |
TESTS |
10 |
295 |
102400 |
|
|
244195365 |
madmax_27 |
C |
Jan. 31, 2024, 3:26 a.m. |
OK |
Java 8 |
TESTS |
14 |
109 |
0 |
|
|
244207217 |
lyongwolf |
C |
Jan. 31, 2024, 5:37 a.m. |
OK |
Java 8 |
TESTS |
15 |
124 |
0 |
|
|
244181259 |
Harwinvanak |
C |
Jan. 30, 2024, 11:07 p.m. |
OK |
Java 8 |
TESTS |
10 |
124 |
0 |
|
|
244141330 |
new__1 |
C |
Jan. 30, 2024, 4:35 p.m. |
OK |
Java 8 |
TESTS |
10 |
140 |
0 |
|
|
244143791 |
RonWonWon |
C |
Jan. 30, 2024, 4:41 p.m. |
OK |
Java 8 |
TESTS |
10 |
155 |
0 |
|
|
244154424 |
RahulAhuja2901 |
C |
Jan. 30, 2024, 6:18 p.m. |
OK |
Java 8 |
TESTS |
10 |
156 |
0 |
|
|
244163793 |
achyut88 |
C |
Jan. 30, 2024, 7:14 p.m. |
OK |
Java 8 |
TESTS |
10 |
218 |
0 |
|
|
244200478 |
coderman2004 |
C |
Jan. 31, 2024, 4:35 a.m. |
OK |
Java 8 |
TESTS |
15 |
280 |
0 |
|
|
244138061 |
prasad9959 |
C |
Jan. 30, 2024, 4:27 p.m. |
OK |
Java 8 |
TESTS |
10 |
280 |
0 |
|
|
244137910 |
KShiva8109 |
C |
Jan. 30, 2024, 4:27 p.m. |
OK |
Java 8 |
TESTS |
10 |
312 |
0 |
|
|
244137024 |
Maharaj7_ |
C |
Jan. 30, 2024, 4:24 p.m. |
OK |
Kotlin 1.9 |
TESTS |
10 |
483 |
0 |
|
|
244135680 |
mircea85 |
C |
Jan. 30, 2024, 4:21 p.m. |
OK |
Mono C# |
TESTS |
10 |
93 |
2969600 |
|
|
244202028 |
aluckyboy |
C |
Jan. 31, 2024, 4:54 a.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
62 |
0 |
|
|
244209268 |
fww |
C |
Jan. 31, 2024, 5:56 a.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
109 |
0 |
|
|
244140904 |
Abhay_Sharma |
C |
Jan. 30, 2024, 4:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
109 |
0 |
|
|
244141149 |
SunlightZero |
C |
Jan. 30, 2024, 4:35 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
124 |
0 |
|
|
244134639 |
Varun985 |
C |
Jan. 30, 2024, 4:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
140 |
0 |
|
|
244173281 |
IITeens |
C |
Jan. 30, 2024, 8:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
155 |
0 |
|
|
244180581 |
maximzasorin |
C |
Jan. 30, 2024, 10:49 p.m. |
OK |
PHP |
TESTS |
10 |
93 |
0 |
|
|
244189822 |
brunocalza |
C |
Jan. 31, 2024, 2:08 a.m. |
OK |
PyPy 2 |
TESTS |
10 |
342 |
5120000 |
|
|
244189478 |
brunocalza |
C |
Jan. 31, 2024, 2:02 a.m. |
OK |
PyPy 2 |
TESTS |
10 |
436 |
4812800 |
|
|
244184387 |
plevande |
C |
Jan. 31, 2024, 12:23 a.m. |
OK |
PyPy 3 |
TESTS |
10 |
296 |
9523200 |
|
|
244162915 |
DrCoder9146 |
C |
Jan. 30, 2024, 7:08 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
420 |
6553600 |
|
|
244137488 |
Harshiv_27 |
C |
Jan. 30, 2024, 4:25 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
451 |
6656000 |
|
|
244165357 |
niyander |
C |
Jan. 30, 2024, 7:27 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
499 |
7270400 |
|
|
244141211 |
pythan |
C |
Jan. 30, 2024, 4:35 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
514 |
7168000 |
|
|
244137417 |
Xannora |
C |
Jan. 30, 2024, 4:25 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
764 |
6758400 |
|
|
244165753 |
niyander |
C |
Jan. 30, 2024, 7:31 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
888 |
9932800 |
|
|
244165574 |
niyander |
C |
Jan. 30, 2024, 7:29 p.m. |
OK |
PyPy 3 |
TESTS |
10 |
1029 |
10547200 |
|
|
244163745 |
the_last_smilodon |
C |
Jan. 30, 2024, 7:14 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
109 |
5939200 |
|
|
244183971 |
OmarMoBadr |
C |
Jan. 31, 2024, 12:13 a.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
109 |
7782400 |
|
|
244179036 |
sbdkdlalit0112 |
C |
Jan. 30, 2024, 10:15 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
109 |
7987200 |
|
|
244163489 |
the_last_smilodon |
C |
Jan. 30, 2024, 7:11 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
5734400 |
|
|
244163687 |
the_last_smilodon |
C |
Jan. 30, 2024, 7:13 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
5939200 |
|
|
244136873 |
_Malware_ |
C |
Jan. 30, 2024, 4:24 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
7168000 |
|
|
244142570 |
minamo_ |
C |
Jan. 30, 2024, 4:39 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
7475200 |
|
|
244194351 |
helltractor |
C |
Jan. 31, 2024, 3:13 a.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
124 |
7987200 |
|
|
244204038 |
SilveryZz |
C |
Jan. 31, 2024, 5:05 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
124 |
8192000 |
|
|
244175366 |
Quick-One |
C |
Jan. 30, 2024, 9:14 p.m. |
OK |
PyPy 3-64 |
TESTS |
10 |
124 |
8806400 |
|
|
244154369 |
OLOGY |
C |
Jan. 30, 2024, 6:18 p.m. |
OK |
Python 2 |
TESTS |
10 |
280 |
1536000 |
|
|
244178353 |
Sheldonxxx |
C |
Jan. 30, 2024, 10:01 p.m. |
OK |
Python 3 |
TESTS |
10 |
186 |
512000 |
|
|
244144796 |
Kanna143 |
C |
Jan. 30, 2024, 4:44 p.m. |
OK |
Python 3 |
TESTS |
10 |
249 |
0 |
|
|
244201977 |
Cipherer |
C |
Jan. 31, 2024, 4:54 a.m. |
OK |
Python 3 |
TESTS |
15 |
249 |
102400 |
|
|
244165022 |
Murad134 |
C |
Jan. 30, 2024, 7:24 p.m. |
OK |
Python 3 |
TESTS |
10 |
265 |
102400 |
|
|
244169877 |
bittercof |
C |
Jan. 30, 2024, 8:09 p.m. |
OK |
Python 3 |
TESTS |
10 |
280 |
0 |
|
|
244190595 |
abhijit07cf |
C |
Jan. 31, 2024, 2:19 a.m. |
OK |
Python 3 |
TESTS |
10 |
280 |
102400 |
|
|
244140986 |
keor |
C |
Jan. 30, 2024, 4:34 p.m. |
OK |
Python 3 |
TESTS |
10 |
296 |
102400 |
|
|
244137837 |
ZeroCoolCorp |
C |
Jan. 30, 2024, 4:26 p.m. |
OK |
Python 3 |
TESTS |
10 |
326 |
102400 |
|
|
244192311 |
CF_Soumyajit |
C |
Jan. 31, 2024, 2:45 a.m. |
OK |
Python 3 |
TESTS |
11 |
327 |
409600 |
|
|
244143293 |
shrey_30 |
C |
Jan. 30, 2024, 4:40 p.m. |
OK |
Python 3 |
TESTS |
10 |
327 |
1024000 |
|
|
244135957 |
atulc036 |
C |
Jan. 30, 2024, 4:22 p.m. |
OK |
Ruby 3 |
TESTS |
10 |
701 |
307200 |
|
|
244189858 |
upupupia |
C |
Jan. 31, 2024, 2:08 a.m. |
OK |
Rust 2021 |
TESTS |
10 |
15 |
0 |
|
|
244144031 |
inverse_ackerman |
C |
Jan. 30, 2024, 4:42 p.m. |
OK |
Rust 2021 |
TESTS |
10 |
30 |
0 |
|
|
remove filters
Back to search problems