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'Alice gave Bob two integers a and b ( a > 0 and b ge 0 ). Being a curious boy, Bob wrote down an array of non-negative integers with operatorname{MEX} value of all elements equal to a and operatorname{XOR} value of all elements equal to b . What is the shortest possible length of the array Bob wrote? Recall that the operatorname{MEX} (Minimum EXcluded) of an array is the minimum non-negative integer that does not belong to the array and the operatorname{XOR} of an array is the bitwise XOR of all the elements of the array. The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 5 cdot 10^4 ) -- the number of test cases. The description of the test cases follows. The only line of each test case contains two integers a and b ( 1 <= q a <= q 3 cdot 10^5 ; 0 <= q b <= q 3 cdot 10^5 ) -- the operatorname{MEX} and operatorname{XOR} of the array, respectively. For each test case, output one (positive) integer -- the length of the shortest array with operatorname{MEX} a and operatorname{XOR} b . We can show that such an array always exists. In the first test case, one of the shortest arrays with operatorname{MEX} 1 and operatorname{XOR} 1 is [0, 2020, 2021] . In the second test case, one of the shortest arrays with operatorname{MEX} 2 and operatorname{XOR} 1 is [0, 1] . It can be shown that these arrays are the shortest arrays possible. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
128001969 |
gxlois |
B |
Sept. 6, 2021, 12:29 a.m. |
OK |
D |
TESTS |
15 |
61 |
6041600 |
|
|
127984638 |
ruban |
B |
Sept. 5, 2021, 5:27 p.m. |
OK |
Delphi |
TESTS |
15 |
62 |
17305600 |
|
|
127973506 |
Anhng.194 |
B |
Sept. 5, 2021, 4:08 p.m. |
OK |
FPC |
TESTS |
15 |
186 |
4608000 |
|
|
127973068 |
TJ.C |
B |
Sept. 5, 2021, 4:06 p.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
3686400 |
|
|
127976490 |
Iizshit |
B |
Sept. 5, 2021, 4:17 p.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
3686400 |
|
|
127984769 |
murali_33 |
B |
Sept. 5, 2021, 5:27 p.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
3686400 |
|
|
127994173 |
vladislav_k |
B |
Sept. 5, 2021, 7:55 p.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
3686400 |
|
|
128011651 |
murali_33 |
B |
Sept. 6, 2021, 4:39 a.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
3686400 |
|
|
127989272 |
yycyyc |
B |
Sept. 5, 2021, 6:22 p.m. |
OK |
GNU C11 |
TESTS |
15 |
202 |
4915200 |
|
|
127997597 |
Sharma_Jayant |
B |
Sept. 5, 2021, 9:30 p.m. |
OK |
GNU C11 |
TESTS |
15 |
217 |
4915200 |
|
|
127989927 |
parasmahour15 |
B |
Sept. 5, 2021, 6:32 p.m. |
OK |
GNU C11 |
TESTS |
15 |
218 |
3686400 |
|
|
127997592 |
shivam05 |
B |
Sept. 5, 2021, 9:30 p.m. |
OK |
GNU C11 |
TESTS |
15 |
218 |
4915200 |
|
|
127980114 |
Tag_987 |
B |
Sept. 5, 2021, 4:29 p.m. |
OK |
GNU C11 |
TESTS |
15 |
233 |
3686400 |
|
|
128006010 |
YangTY |
B |
Sept. 6, 2021, 2:28 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
30 |
21708800 |
|
|
128012492 |
sgly33 |
B |
Sept. 6, 2021, 4:57 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
31 |
4915200 |
|
|
128005531 |
8arry |
B |
Sept. 6, 2021, 2:16 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128014932 |
KiseRyouta8 |
B |
Sept. 6, 2021, 5:40 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128012241 |
sakshi_38 |
B |
Sept. 6, 2021, 4:52 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128008887 |
HomuraCN |
B |
Sept. 6, 2021, 3:41 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128008651 |
xuanyuan |
B |
Sept. 6, 2021, 3:35 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128002352 |
xuanyuan |
B |
Sept. 6, 2021, 12:43 a.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
127994146 |
_Surya_ |
B |
Sept. 5, 2021, 7:54 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
127991329 |
flamestorm |
B |
Sept. 5, 2021, 6:55 p.m. |
OK |
GNU C++14 |
TESTS |
15 |
46 |
3686400 |
|
|
128012297 |
LxRBS |
B |
Sept. 6, 2021, 4:53 a.m. |
OK |
GNU C++17 |
TESTS |
15 |
31 |
5017600 |
|
|
127984302 |
astitvaraj |
B |
Sept. 5, 2021, 5:26 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
127986597 |
siddharthagoyal125 |
B |
Sept. 5, 2021, 5:45 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
127993894 |
squids_are_evil |
B |
Sept. 5, 2021, 7:48 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
127994183 |
SrinjoyPaul |
B |
Sept. 5, 2021, 7:55 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
127997391 |
Maxim |
B |
Sept. 5, 2021, 9:22 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
128000834 |
ToolManP |
B |
Sept. 5, 2021, 11:48 p.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
128002594 |
MonkeyDoug |
B |
Sept. 6, 2021, 12:52 a.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
128006449 |
chennanjun |
B |
Sept. 6, 2021, 2:40 a.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
128011897 |
ZhangZHZSFH |
B |
Sept. 6, 2021, 4:45 a.m. |
OK |
GNU C++17 |
TESTS |
15 |
46 |
3686400 |
|
|
127989639 |
marksman_ |
B |
Sept. 5, 2021, 6:27 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127993105 |
ansgar92314 |
B |
Sept. 5, 2021, 7:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127991920 |
sudip777sharma |
B |
Sept. 5, 2021, 7:06 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127991060 |
Bit_Master_2205 |
B |
Sept. 5, 2021, 6:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127987393 |
Joaquin144 |
B |
Sept. 5, 2021, 5:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
128016323 |
_K1ng_ |
B |
Sept. 6, 2021, 6:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
128014539 |
iamgaurav |
B |
Sept. 6, 2021, 5:34 a.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
128010847 |
Siddhu_123 |
B |
Sept. 6, 2021, 4:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
128007786 |
CODERGARV |
B |
Sept. 6, 2021, 3:15 a.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127996617 |
MazenBatrawi |
B |
Sept. 5, 2021, 8:58 p.m. |
OK |
GNU C++17 (64) |
TESTS |
15 |
31 |
4300800 |
|
|
127986636 |
kriticalflare |
B |
Sept. 5, 2021, 5:46 p.m. |
OK |
Java 11 |
TESTS |
15 |
187 |
23859200 |
|
|
128001415 |
henrychenOutlook |
B |
Sept. 6, 2021, 12:10 a.m. |
OK |
Java 11 |
TESTS |
15 |
202 |
23859200 |
|
|
128008781 |
aym_05 |
B |
Sept. 6, 2021, 3:38 a.m. |
OK |
Java 11 |
TESTS |
15 |
217 |
23859200 |
|
|
128000492 |
Nicolas125841 |
B |
Sept. 5, 2021, 11:33 p.m. |
OK |
Java 11 |
TESTS |
15 |
217 |
23859200 |
|
|
127991428 |
TheRunner |
B |
Sept. 5, 2021, 6:57 p.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
128009852 |
smodak2000 |
B |
Sept. 6, 2021, 4:01 a.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
128006031 |
sauravmandal |
B |
Sept. 6, 2021, 2:29 a.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
128002959 |
BestEveryman |
B |
Sept. 6, 2021, 1:04 a.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
127994017 |
procrastinate7 |
B |
Sept. 5, 2021, 7:51 p.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
127987068 |
SaberXpro |
B |
Sept. 5, 2021, 5:51 p.m. |
OK |
Java 11 |
TESTS |
15 |
218 |
23859200 |
|
|
128006954 |
wyxfwxh250821 |
B |
Sept. 6, 2021, 2:54 a.m. |
OK |
Java 8 |
TESTS |
15 |
109 |
20275200 |
|
|
128002411 |
saltedfish54250 |
B |
Sept. 6, 2021, 12:46 a.m. |
OK |
Java 8 |
TESTS |
15 |
109 |
20480000 |
|
|
127987011 |
iarvind |
B |
Sept. 5, 2021, 5:50 p.m. |
OK |
Java 8 |
TESTS |
15 |
139 |
20480000 |
|
|
128007058 |
omar_mohammed |
B |
Sept. 6, 2021, 2:56 a.m. |
OK |
Java 8 |
TESTS |
15 |
140 |
20480000 |
|
|
128010021 |
Dark_Reunion |
B |
Sept. 6, 2021, 4:05 a.m. |
OK |
Java 8 |
TESTS |
15 |
140 |
20480000 |
|
|
128007235 |
thedesalizes |
B |
Sept. 6, 2021, 3:02 a.m. |
OK |
Java 8 |
TESTS |
15 |
140 |
20480000 |
|
|
127990077 |
PRIYANSH_TOMAR |
B |
Sept. 5, 2021, 6:34 p.m. |
OK |
Java 8 |
TESTS |
15 |
140 |
20684800 |
|
|
127988937 |
manan_0104 |
B |
Sept. 5, 2021, 6:17 p.m. |
OK |
Java 8 |
TESTS |
15 |
140 |
20684800 |
|
|
127986149 |
gssakash |
B |
Sept. 5, 2021, 5:39 p.m. |
OK |
Java 8 |
TESTS |
15 |
155 |
20480000 |
|
|
127984989 |
slow.coder |
B |
Sept. 5, 2021, 5:29 p.m. |
OK |
Java 8 |
TESTS |
15 |
155 |
20480000 |
|
|
127973890 |
kotlik |
B |
Sept. 5, 2021, 4:09 p.m. |
OK |
Kotlin |
TESTS |
15 |
483 |
20992000 |
|
|
127979410 |
yoji_20 |
B |
Sept. 5, 2021, 4:27 p.m. |
OK |
Kotlin |
TESTS |
15 |
514 |
21811200 |
|
|
127976321 |
UZMath |
B |
Sept. 5, 2021, 4:17 p.m. |
OK |
Kotlin |
TESTS |
15 |
514 |
47820800 |
|
|
127974595 |
Kigh |
B |
Sept. 5, 2021, 4:11 p.m. |
OK |
Kotlin |
TESTS |
15 |
545 |
21811200 |
|
|
127979448 |
mbakalov |
B |
Sept. 5, 2021, 4:27 p.m. |
OK |
Mono C# |
TESTS |
15 |
374 |
15462400 |
|
|
127974130 |
TheRomulus |
B |
Sept. 5, 2021, 4:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
93 |
3788800 |
|
|
127985386 |
skag1 |
B |
Sept. 5, 2021, 5:32 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
124 |
3788800 |
|
|
128013817 |
swz |
B |
Sept. 6, 2021, 5:21 a.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
124 |
4915200 |
|
|
127974610 |
cmj0922 |
B |
Sept. 5, 2021, 4:11 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
124 |
4915200 |
|
|
127973206 |
TheGoodest |
B |
Sept. 5, 2021, 4:07 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
155 |
3788800 |
|
|
127973925 |
Akko1233211 |
B |
Sept. 5, 2021, 4:09 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
218 |
4915200 |
|
|
128007795 |
gekkouria |
B |
Sept. 6, 2021, 3:15 a.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
264 |
4915200 |
|
|
127995902 |
lhcalphaA |
B |
Sept. 5, 2021, 8:37 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
280 |
3788800 |
|
|
127988989 |
IlyinAD |
B |
Sept. 5, 2021, 6:18 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
280 |
3788800 |
|
|
127988073 |
ishitav |
B |
Sept. 5, 2021, 6:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
15 |
280 |
3788800 |
|
|
127987483 |
snapiproof |
B |
Sept. 5, 2021, 5:56 p.m. |
OK |
.NET Core C# |
TESTS |
15 |
358 |
14438400 |
|
|
127987798 |
Marshmello |
B |
Sept. 5, 2021, 6:01 p.m. |
OK |
PyPy 2 |
TESTS |
15 |
889 |
30822400 |
|
|
127984955 |
Terryobeyes |
B |
Sept. 5, 2021, 5:28 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
233 |
28672000 |
|
|
127991419 |
Het_Fadia |
B |
Sept. 5, 2021, 6:56 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
233 |
29081600 |
|
|
127976876 |
Sangram_Jagadale |
B |
Sept. 5, 2021, 4:19 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
233 |
30003200 |
|
|
128009801 |
jerinjoseantony |
B |
Sept. 6, 2021, 4 a.m. |
OK |
PyPy 3 |
TESTS |
15 |
233 |
30822400 |
|
|
128006496 |
Terryobeyes |
B |
Sept. 6, 2021, 2:41 a.m. |
OK |
PyPy 3 |
TESTS |
15 |
264 |
28569600 |
|
|
127988383 |
neel0086 |
B |
Sept. 5, 2021, 6:09 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
264 |
29696000 |
|
|
127988716 |
duck |
B |
Sept. 5, 2021, 6:14 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
264 |
29798400 |
|
|
128000552 |
lebron87 |
B |
Sept. 5, 2021, 11:36 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
280 |
29593600 |
|
|
127991396 |
Het_Fadia |
B |
Sept. 5, 2021, 6:56 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
280 |
29593600 |
|
|
128000577 |
lebron87 |
B |
Sept. 5, 2021, 11:37 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
280 |
29696000 |
|
|
128013660 |
codemakerself |
B |
Sept. 6, 2021, 5:18 a.m. |
OK |
Python 3 |
TESTS |
15 |
202 |
7372800 |
|
|
127995921 |
eugalt |
B |
Sept. 5, 2021, 8:38 p.m. |
OK |
Python 3 |
TESTS |
15 |
202 |
9420800 |
|
|
128012424 |
edusanketdk |
B |
Sept. 6, 2021, 4:55 a.m. |
OK |
Python 3 |
TESTS |
15 |
217 |
7577600 |
|
|
128014479 |
Land_oF_cOdErS |
B |
Sept. 6, 2021, 5:33 a.m. |
OK |
Python 3 |
TESTS |
15 |
218 |
7782400 |
|
|
128008963 |
FrozenKandy |
B |
Sept. 6, 2021, 3:42 a.m. |
OK |
Python 3 |
TESTS |
15 |
327 |
15872000 |
|
|
127977328 |
vwxyz0 |
B |
Sept. 5, 2021, 4:20 p.m. |
OK |
Python 3 |
TESTS |
15 |
343 |
12185600 |
|
|
127999573 |
radoan.sharkar.richi |
B |
Sept. 5, 2021, 10:52 p.m. |
OK |
Python 3 |
TESTS |
15 |
358 |
18944000 |
|
|
128015272 |
prathamnagaria |
B |
Sept. 6, 2021, 5:46 a.m. |
OK |
Python 3 |
TESTS |
15 |
467 |
6963200 |
|
|
127984919 |
Antifreeze |
B |
Sept. 5, 2021, 5:28 p.m. |
OK |
Python 3 |
TESTS |
15 |
468 |
6963200 |
|
|
127980212 |
Adras |
B |
Sept. 5, 2021, 4:30 p.m. |
OK |
Python 3 |
TESTS |
15 |
483 |
6963200 |
|
|
127991493 |
ssvb |
B |
Sept. 5, 2021, 6:58 p.m. |
OK |
Ruby 3 |
TESTS |
15 |
452 |
51404800 |
|
|
128000410 |
Spheniscine |
B |
Sept. 5, 2021, 11:30 p.m. |
OK |
Rust |
TESTS |
15 |
31 |
6963200 |
|
|
128000562 |
Spheniscine |
B |
Sept. 5, 2021, 11:36 p.m. |
OK |
Rust |
TESTS |
15 |
46 |
3891200 |
|
|
127993104 |
apilat |
B |
Sept. 5, 2021, 7:31 p.m. |
OK |
Rust |
TESTS |
15 |
46 |
6246400 |
|
|
127986134 |
SorKierkegaard |
B |
Sept. 5, 2021, 5:39 p.m. |
OK |
Rust |
TESTS |
15 |
46 |
6963200 |
|
|
remove filters
Back to search problems