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'As mentioned previously William really likes playing video games. In one of his favorite games, the player character is in a universe where every planet is designated by a binary number from 0 to 2^n - 1 . On each planet, there are gates that allow the player to move from planet i to planet j if the binary representations of i and j differ in exactly one bit. William wants to test you and see how you can handle processing the following queries in this game universe: The first line contains two integers n , m ( 1 <= q n <= q 50 , 1 <= q m <= q 5 cdot 10^4 ), which are the number of bits in binary representation of each planets ' designation and the number of queries, respectively. Each of the next m lines contains a query of two types: block l r -- query for destruction of planets with numbers from l to r inclusively ( 0 <= l <= r < 2^n ). It 's guaranteed that no planet will be destroyed twice. ask a b -- query for reachability between planets a and b ( 0 <= a, b < 2^n ). It 's guaranteed that planets a and b hasn 't been destroyed yet. For each query of type ask you must output "1" in a new line, if it is possible to reach planet b from planet a and "0" otherwise (without quotation marks). The first example test can be visualized in the following way: Response to a query ask 0 7 is positive. Next after query block 3 6 the graph will look the following way (destroyed vertices are highlighted): Response to a query ask 0 7 is negative, since any path from vertex 0 to vertex 7 must go through one of the destroyed vertices. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
127397084 |
sh1194 |
G |
Aug. 29, 2021, 6:38 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
1996 |
595763200 |
|
3300 |
127397039 |
sh1194 |
G |
Aug. 29, 2021, 6:37 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
2167 |
595763200 |
|
3300 |
127382224 |
ugly2333 |
G |
Aug. 29, 2021, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
2245 |
595763200 |
|
3300 |
127379900 |
Radewoosh |
G |
Aug. 29, 2021, 4:25 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
3353 |
773529600 |
|
3300 |
127396011 |
.monkey |
G |
Aug. 29, 2021, 6:23 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
405 |
89497600 |
|
3300 |
127419614 |
avinashdokala2002 |
G |
Aug. 30, 2021, 5:46 a.m. |
OK |
GNU C++17 |
TESTS |
37 |
795 |
189235200 |
|
3300 |
127398050 |
SirShokoladina |
G |
Aug. 29, 2021, 6:54 p.m. |
OK |
GNU C++17 |
TESTS |
36 |
982 |
257024000 |
|
3300 |
127397536 |
never_giveup |
G |
Aug. 29, 2021, 6:45 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
1075 |
105472000 |
|
3300 |
127394350 |
Benq |
G |
Aug. 29, 2021, 6:06 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
1684 |
19046400 |
|
3300 |
127386180 |
Golovanov399 |
G |
Aug. 29, 2021, 4:48 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
2854 |
838348800 |
|
3300 |
127387460 |
yhx-12243 |
G |
Aug. 29, 2021, 4:52 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
3025 |
523878400 |
|
3300 |
127388751 |
nick452 |
G |
Aug. 29, 2021, 4:57 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
3103 |
48128000 |
|
3300 |
127403281 |
sam.rei |
G |
Aug. 29, 2021, 9:08 p.m. |
OK |
GNU C++17 |
TESTS |
37 |
3213 |
354713600 |
|
3300 |
127417272 |
ecnerwala |
G |
Aug. 30, 2021, 5:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
248 |
74649600 |
|
3300 |
127387983 |
jiangly |
G |
Aug. 29, 2021, 4:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
327 |
93081600 |
|
3300 |
127386088 |
Um_nik |
G |
Aug. 29, 2021, 4:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
780 |
890060800 |
|
3300 |
127407584 |
Um_nik |
G |
Aug. 30, 2021, 12:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
1356 |
850022400 |
|
3300 |
127407653 |
Um_nik |
G |
Aug. 30, 2021, 12:31 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
1372 |
519372800 |
|
3300 |
127407566 |
Um_nik |
G |
Aug. 30, 2021, 12:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
1372 |
870092800 |
|
3300 |
127407608 |
Um_nik |
G |
Aug. 30, 2021, 12:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
1419 |
839987200 |
|
3300 |
127394336 |
kefaa2 |
G |
Aug. 29, 2021, 6:06 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
1434 |
498380800 |
|
3300 |
127407647 |
Um_nik |
G |
Aug. 30, 2021, 12:31 a.m. |
OK |
GNU C++17 (64) |
TESTS |
37 |
1450 |
599552000 |
|
3300 |
127397240 |
DmitryGrigorev |
G |
Aug. 29, 2021, 6:40 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
2729 |
564531200 |
|
3300 |
remove filters
Back to search problems