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.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1168 | Codeforces Round 562 (Div. 1) | FINISHED | False | 7200 | 172938299 | May 26, 2019, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2432 ) | C | And Reachability | PROGRAMMING | bitmasks dp | 2400 |
B'Toad Pimple has an array of integers a_1, a_2, ldots, a_n . We say that y is reachable from x if x<y and there exists an integer array p such that x = p_1 < p_2 < ldots < p_k=y , and a_{p_i} , & , a_{p_{i+1}} > 0 for all integers i such that 1 <= q i < k . Here & denotes the bitwise AND operation. You are given q pairs of indices, check reachability for each of them. The first line contains two integers n and q ( 2 <= q n <= q 300 ,000 , 1 <= q q <= q 300 ,000 ) -- the number of integers in the array and the number of queries you need to answer. The second line contains n space-separated integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 300 ,000 ) -- the given array. The next q lines contain two integers each. The i -th of them contains two space-separated integers x_i and y_i ( 1 <= q x_i < y_i <= q n ). You need to check if y_i is reachable from x_i . Output q lines. In the i -th of them print "Shi" if y_i is reachable from x_i , otherwise, print "Fou". In the first example, a_3 = 0 . You can 't reach it, because AND with it is always zero. a_2 , & , a_4 > 0 , so 4 is reachable from 2 , and to go from 1 to 4 you can use p = [1, 2, 4] . '... |
Codeforces Round #562 — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
54675360 | yosupo | C | May 26, 2019, 3:54 p.m. | OK | D | TESTS | 27 | 623 | 45977600 | 2400 | |
54814047 | about | C | May 29, 2019, 6:36 p.m. | OK | GNU C11 | TESTS | 27 | 1247 | 25190400 | 2400 | |
54823113 | cly_none | C | May 30, 2019, 4:43 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 24064000 | 2400 | |
55610814 | ReaLNero1 | C | June 16, 2019, 5:36 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 24064000 | 2400 | |
58199915 | Big_black_jujube | C | Aug. 3, 2019, 3:28 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 25292800 | 2400 | |
54826481 | ouqingliang | C | May 30, 2019, 6:44 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 25292800 | 2400 | |
58199968 | Big_black_jujube | C | Aug. 3, 2019, 3:30 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 25292800 | 2400 | |
54907014 | Karnage | C | June 1, 2019, 9:17 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 26316800 | 2400 | |
63385455 | x_faraway_x | C | Oct. 25, 2019, 1:39 p.m. | OK | GNU C++11 | TESTS | 27 | 171 | 31232000 | 2400 | |
54963516 | zekrom_dream | C | June 2, 2019, 5:13 a.m. | OK | GNU C++11 | TESTS | 27 | 171 | 50483200 | 2400 | |
64726482 | sry_ | C | Nov. 12, 2019, 6:39 a.m. | OK | GNU C++11 | TESTS | 27 | 186 | 26419200 | 2400 | |
54896660 | Amphetamine | C | June 1, 2019, 3:22 a.m. | OK | GNU C++11 | TESTS | 27 | 186 | 31232000 | 2400 | |
54741375 | Newusers | C | May 28, 2019, 8:08 a.m. | OK | GNU C++14 | TESTS | 27 | 265 | 24064000 | 2400 | |
54687946 | PedyD | C | May 26, 2019, 5 p.m. | OK | GNU C++14 | TESTS | 27 | 280 | 25600000 | 2400 | |
54695753 | Linkus | C | May 26, 2019, 7 p.m. | OK | GNU C++14 | TESTS | 27 | 280 | 65126400 | 2400 | |
55015756 | TiChuot97 | C | June 3, 2019, 12:15 p.m. | OK | GNU C++14 | TESTS | 27 | 296 | 24064000 | 2400 | |
54697378 | DimmyT | C | May 26, 2019, 7:54 p.m. | OK | GNU C++14 | TESTS | 27 | 296 | 55296000 | 2400 | |
55533692 | himanshu_attri | C | June 13, 2019, 3:05 p.m. | OK | GNU C++14 | TESTS | 27 | 311 | 24064000 | 2400 | |
63927857 | MinecraftFuns | C | Oct. 31, 2019, 1:31 p.m. | OK | GNU C++14 | TESTS | 27 | 311 | 25702400 | 2400 | |
56447744 | ultramanzero | C | July 2, 2019, 7:45 p.m. | OK | GNU C++14 | TESTS | 27 | 312 | 24064000 | 2400 | |
54678836 | ae04071 | C | May 26, 2019, 4:08 p.m. | OK | GNU C++14 | TESTS | 27 | 312 | 24064000 | 2400 | |
60067481 | yum1233123 | C | Sept. 5, 2019, 9:44 a.m. | OK | GNU C++14 | TESTS | 27 | 312 | 24064000 | 2400 | |
54846089 | Errichto | C | May 30, 2019, 1:58 p.m. | OK | GNU C++17 | TESTS | 27 | 311 | 24064000 | 2400 | |
55406463 | kyo_key | C | June 10, 2019, 4:50 p.m. | OK | GNU C++17 | TESTS | 27 | 311 | 24064000 | 2400 | |
55322286 | hongzhiyin | C | June 9, 2019, 5:42 a.m. | OK | GNU C++17 | TESTS | 27 | 312 | 25292800 | 2400 | |
54694587 | flashmt | C | May 26, 2019, 6:30 p.m. | OK | GNU C++17 | TESTS | 27 | 327 | 24064000 | 2400 | |
57299364 | fsshakkhor | C | July 18, 2019, 9:38 p.m. | OK | GNU C++17 | TESTS | 27 | 327 | 25292800 | 2400 | |
55106224 | AbsentMinded | C | June 5, 2019, 2:53 a.m. | OK | GNU C++17 | TESTS | 27 | 327 | 25292800 | 2400 | |
54682755 | milisav | C | May 26, 2019, 4:27 p.m. | OK | GNU C++17 | TESTS | 27 | 327 | 25702400 | 2400 | |
54830001 | vjudge5 | C | May 30, 2019, 8:29 a.m. | OK | GNU C++17 | TESTS | 27 | 327 | 26419200 | 2400 | |
54850813 | Mjgonzales | C | May 30, 2019, 4:29 p.m. | OK | GNU C++17 | TESTS | 27 | 327 | 27648000 | 2400 | |
62081688 | 3015218054 | C | Oct. 7, 2019, 9:10 p.m. | OK | GNU C++17 | TESTS | 27 | 327 | 28876800 | 2400 | |
55124800 | tkachenko | C | June 5, 2019, 12:20 p.m. | OK | Go | TESTS | 27 | 1341 | 28057600 | 2400 | |
55124355 | tkachenko | C | June 5, 2019, 12:09 p.m. | OK | Go | TESTS | 27 | 1450 | 27955200 | 2400 | |
55120178 | tkachenko | C | June 5, 2019, 10:42 a.m. | OK | Go | TESTS | 27 | 1590 | 59596800 | 2400 | |
55972816 | mbfeci | C | June 23, 2019, 3:44 p.m. | OK | Java 8 | TESTS | 27 | 452 | 31232000 | 2400 | |
54683287 | Petr | C | May 26, 2019, 4:30 p.m. | OK | Java 8 | TESTS | 27 | 498 | 13107200 | 2400 | |
54760747 | dalt | C | May 28, 2019, 3:47 p.m. | OK | Java 8 | TESTS | 27 | 592 | 32358400 | 2400 | |
55972755 | mbfeci | C | June 23, 2019, 3:43 p.m. | OK | Java 8 | TESTS | 27 | 748 | 39219200 | 2400 | |
54681779 | uwi | C | May 26, 2019, 4:22 p.m. | OK | Java 8 | TESTS | 27 | 795 | 35430400 | 2400 | |
54694741 | NighTurs | C | May 26, 2019, 6:32 p.m. | OK | Java 8 | TESTS | 27 | 826 | 54374400 | 2400 | |
60586639 | beginner1010 | C | Sept. 14, 2019, 9:46 p.m. | OK | Java 8 | TESTS | 27 | 919 | 60006400 | 2400 | |
54692922 | danbanica | C | May 26, 2019, 5:34 p.m. | OK | Java 8 | TESTS | 27 | 1013 | 57856000 | 2400 | |
58528966 | satya26 | C | Aug. 10, 2019, 8:33 a.m. | OK | Java 8 | TESTS | 27 | 1014 | 49254400 | 2400 | |
54678517 | qwerty787788 | C | May 26, 2019, 4:06 p.m. | OK | Java 8 | TESTS | 27 | 1044 | 43417600 | 2400 | |
54881602 | vjudge5 | C | May 31, 2019, 2:39 p.m. | OK | MS C++ | TESTS | 27 | 374 | 31232000 | 2400 | |
67785731 | gearjack | C | Dec. 28, 2019, 12:41 p.m. | OK | Rust | TESTS | 27 | 389 | 44544000 | 2400 | |
55199748 | EbTech | C | June 6, 2019, 10:03 a.m. | OK | Rust | TESTS | 27 | 405 | 31436800 | 2400 | |
55268618 | EbTech | C | June 7, 2019, 3:32 p.m. | OK | Rust | TESTS | 27 | 436 | 34611200 | 2400 | |
55216915 | EbTech | C | June 6, 2019, 5:15 p.m. | OK | Rust | TESTS | 27 | 436 | 35532800 | 2400 | |
55199486 | EbTech | C | June 6, 2019, 9:57 a.m. | OK | Rust | TESTS | 27 | 452 | 35532800 | 2400 | |
54863746 | EbTech | C | May 31, 2019, 4:39 a.m. | OK | Rust | TESTS | 27 | 545 | 38092800 | 2400 | |
56764175 | julius_snezer | C | July 9, 2019, 5:23 p.m. | OK | Rust | TESTS | 27 | 560 | 37990400 | 2400 | |
54857284 | EbTech | C | May 30, 2019, 8:33 p.m. | OK | Rust | TESTS | 27 | 561 | 38297600 | 2400 | |
54903321 | EbTech | C | June 1, 2019, 7:43 a.m. | OK | Rust | TESTS | 27 | 576 | 38092800 | 2400 | |
55200038 | EbTech | C | June 6, 2019, 10:11 a.m. | OK | Rust | TESTS | 27 | 577 | 38092800 | 2400 | |
54697514 | Ferume | C | May 26, 2019, 7:59 p.m. | OK | Scala | TESTS | 27 | 1138 | 69632000 | 2400 | |
54686628 | limed | C | May 26, 2019, 4:52 p.m. | OK | Scala | TESTS | 27 | 1216 | 69632000 | 2400 | |
54807500 | limed | C | May 29, 2019, 2:58 p.m. | OK | Scala | TESTS | 27 | 2184 | 69734400 | 2400 | |
54807690 | limed | C | May 29, 2019, 3:04 p.m. | OK | Scala | TESTS | 27 | 2199 | 69632000 | 2400 |
Back to search problems