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"For a set of integers S , let's define its cost as the minimum value of x oplus y among all pairs of different integers from the set (here, oplus denotes bitwise XOR). If there are less than two elements in the set, its cost is equal to 2^{30} . You are given a set of integers {a_1, a_2, ... , a_n } . You have to partition it into two sets S_1 and S_2 in such a way that every element of the given set belongs to exactly one of these two sets. The value of the partition is the minimum among the costs of S_1 and S_2 . Find the partition with the maximum possible value. The first line contains n ( 2 <= n <= 200000 ) -- the number of elements in the set. The second line contains n distinct integers a_1 , a_2 , ..., a_n ( 0 <= a_i < 2^{30} ) -- the elements of the set. Print a string n characters 0 and/or 1 describing the partition as follows: the i -th character should be 0 if the element a_i belongs to S_1 , otherwise, that character should be 1. If there are multiple optimal answers, print any of them. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
216032091 |
creating001 |
F |
July 28, 2023, 2:46 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
93 |
1843200 |
|
|
216047348 |
creating001 |
F |
July 28, 2023, 6:02 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
561 |
27955200 |
|
|
215998152 |
my_name_is_handsome |
F |
July 27, 2023, 6:22 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
904 |
230502400 |
|
|
215980817 |
Valters07 |
F |
July 27, 2023, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
1216 |
19865600 |
|
|
216001877 |
wrihapcod |
F |
July 27, 2023, 6:59 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
1778 |
44236800 |
|
|
216027116 |
omeganot |
F |
July 28, 2023, 1:41 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
2121 |
187392000 |
|
|
216012884 |
peti1234 |
F |
July 27, 2023, 9:14 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
140 |
48128000 |
|
|
216045338 |
shnirelman |
F |
July 28, 2023, 5:38 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
156 |
265830400 |
|
|
216025164 |
jdurie |
F |
July 28, 2023, 1:13 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
202 |
12390400 |
|
|
215986418 |
adnanmousllli |
F |
July 27, 2023, 4:57 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
202 |
127488000 |
|
|
215984175 |
pmqwerty |
F |
July 27, 2023, 4:47 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
202 |
127488000 |
|
|
215984052 |
NaimSS |
F |
July 27, 2023, 4:46 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
233 |
6144000 |
|
|
216020840 |
NaimSS |
F |
July 27, 2023, 11:50 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
265 |
20275200 |
|
|
215997376 |
risel |
F |
July 27, 2023, 6:16 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
265 |
20275200 |
|
|
215995162 |
sumit_kk10 |
F |
July 27, 2023, 5:56 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
421 |
27033600 |
|
|
216018097 |
lookcook |
F |
July 27, 2023, 10:47 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
467 |
13824000 |
|
|
215984817 |
YocyCraft |
F |
July 27, 2023, 4:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
78 |
5939200 |
|
|
215996658 |
like_a_dream |
F |
July 27, 2023, 6:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
202 |
6656000 |
|
|
215989687 |
FEDIKUS |
F |
July 27, 2023, 5:17 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
233 |
9011200 |
|
|
215993249 |
Rubikun |
F |
July 27, 2023, 5:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
312 |
14950400 |
|
|
216040360 |
chappy1 |
F |
July 28, 2023, 4:33 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
483 |
2457600 |
|
|
216018379 |
enslaved |
F |
July 27, 2023, 10:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
732 |
178176000 |
|
|
215997779 |
Geothermal |
F |
July 27, 2023, 6:19 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
920 |
15667200 |
|
|
216014063 |
stan23456 |
F |
July 27, 2023, 9:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
1138 |
18636800 |
|
|
216035079 |
triple__a |
F |
July 28, 2023, 3:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
1356 |
75776000 |
|
|
215981919 |
noimi |
F |
July 27, 2023, 4:38 p.m. |
OK |
GNU C++17 (64) |
TESTS |
39 |
1450 |
95027200 |
|
|
215993266 |
tatavayapmabulldogvd |
F |
July 27, 2023, 5:43 p.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
62 |
1843200 |
|
|
215992821 |
propane |
F |
July 27, 2023, 5:39 p.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
62 |
1843200 |
|
|
216033668 |
areke |
F |
July 28, 2023, 3:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
62 |
3584000 |
|
|
216029372 |
shcal |
F |
July 28, 2023, 2:12 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
62 |
4096000 |
|
|
216032242 |
zhensuan |
F |
July 28, 2023, 2:48 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
93 |
4812800 |
|
|
216024310 |
I_love_GSNQK |
F |
July 28, 2023, 12:59 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
93 |
5427200 |
|
|
216001858 |
lamter |
F |
July 27, 2023, 6:58 p.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
93 |
8192000 |
|
|
216040080 |
nor |
F |
July 28, 2023, 4:29 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
93 |
8294400 |
|
|
216024443 |
HHY_zZhu |
F |
July 28, 2023, 1:02 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
109 |
3788800 |
|
|
216040062 |
nor |
F |
July 28, 2023, 4:29 a.m. |
OK |
GNU C++20 (64) |
TESTS |
39 |
124 |
8089600 |
|
|
216037551 |
dzhi |
F |
July 28, 2023, 3:56 a.m. |
OK |
Java 11 |
TESTS |
39 |
1028 |
49049600 |
|
|
216037867 |
dzhi |
F |
July 28, 2023, 4 a.m. |
OK |
Java 11 |
TESTS |
39 |
1029 |
48947200 |
|
|
remove filters
Back to search problems