Codeforces Round 558 (Div. 2)

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
1163 Codeforces Round 558 (Div. 2) FINISHED False 7200 174408899 May 9, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 686 ) E Magical Permutation PROGRAMMING bitmasks brute force constructive algorithms data structures graphs math 2800

B'Kuro has just learned about permutations and he is really excited to create a new permutation type. He has chosen n distinct positive integers and put all of them in a set S . Now he defines a magical permutation to be: Since Kuro is really excited about magical permutations, he wants to create the longest magical permutation possible. In other words, he wants to find the largest non-negative integer x such that there is a magical permutation of integers from 0 to 2^x - 1 . Since he is a newbie in the subject, he wants you to help him find this value of x and also the magical permutation for that x . The first line contains the integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of elements in the set S . The next line contains n distinct integers S_1, S_2, ldots, S_n ( 1 <= q S_i <= q 2 cdot 10^5 ) -- the elements in the set S . In the first line print the largest non-negative integer x , such that there is a magical permutation of integers from 0 to 2^x - 1 . Then print 2^x integers describing a magical permutation of integers from 0 to 2^x - 1 . If there are multiple such magical permutations, print any of them. In the first example, 0, 1, 3, 2 is a magical permutation since: Where oplus denotes bitwise xor operation. '...

Tutorials

66943

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53933052 about E May 9, 2019, 7:39 p.m. OK GNU C11 TESTS 71 93 2867200 2800
60925804 CYJian E Sept. 20, 2019, 12:14 p.m. OK GNU C++11 TESTS 72 46 5836800 2800
60925747 CYJJJian E Sept. 20, 2019, 12:12 p.m. OK GNU C++11 TESTS 72 61 5836800 2800
55226822 justin_cao E June 7, 2019, 2:22 a.m. OK GNU C++11 TESTS 72 77 1945600 2800
68840498 vjudge2 E Jan. 15, 2020, 5:36 a.m. OK GNU C++11 TESTS 72 78 1740800 2800
53940513 wjyyy E May 10, 2019, 2:36 a.m. OK GNU C++11 TESTS 71 78 2764800 2800
53944453 lzoilxy E May 10, 2019, 5:42 a.m. OK GNU C++11 TESTS 71 78 16691200 2800
53962187 dqa2020 E May 10, 2019, 2:49 p.m. OK GNU C++11 TESTS 71 93 1638400 2800
53917883 xht37 E May 9, 2019, 3:46 p.m. OK GNU C++11 TESTS 71 93 1945600 2800
61419787 code_struck E Sept. 28, 2019, 11:24 a.m. OK GNU C++11 TESTS 72 93 4300800 2800
63387943 p_b_p_b E Oct. 25, 2019, 2:19 p.m. OK GNU C++11 TESTS 72 93 6963200 2800
54094394 CodePlatina E May 14, 2019, 12:24 p.m. OK GNU C++14 TESTS 72 93 1740800 2800
53956041 pr3pony E May 10, 2019, 11:55 a.m. OK GNU C++14 TESTS 71 93 2457600 2800
53927353 beka_asd E May 9, 2019, 4:46 p.m. OK GNU C++14 TESTS 71 108 819200 2800
53931469 risujiroh E May 9, 2019, 6:03 p.m. OK GNU C++14 TESTS 71 108 921600 2800
54468432 emoairx E May 22, 2019, 2:53 a.m. OK GNU C++14 TESTS 72 108 2969600 2800
53960507 Origenes E May 10, 2019, 1:54 p.m. OK GNU C++14 TESTS 71 108 5734400 2800
54026223 LODB---D E May 12, 2019, 12:44 p.m. OK GNU C++14 TESTS 72 108 8294400 2800
55531793 I_love_chickpea E June 13, 2019, 1:58 p.m. OK GNU C++14 TESTS 72 109 819200 2800
53955976 pr3pony E May 10, 2019, 11:54 a.m. OK GNU C++14 TESTS 71 109 1740800 2800
54432883 leign E May 21, 2019, 2:07 a.m. OK GNU C++14 TESTS 72 109 2457600 2800
55610894 ReaLNero1 E June 16, 2019, 5:39 a.m. OK GNU C++17 TESTS 72 46 2457600 2800
54456680 neal E May 21, 2019, 4:15 p.m. OK GNU C++17 TESTS 72 46 2457600 2800
54456620 neal E May 21, 2019, 4:14 p.m. OK GNU C++17 TESTS 72 62 2457600 2800
53951788 armoking E May 10, 2019, 9:54 a.m. OK GNU C++17 TESTS 71 78 10649600 2800
54456298 neal E May 21, 2019, 4:03 p.m. OK GNU C++17 TESTS 72 93 2457600 2800
55078452 RNS_JKS E June 4, 2019, 9:42 a.m. OK GNU C++17 TESTS 72 93 4198400 2800
53951702 armoking E May 10, 2019, 9:52 a.m. OK GNU C++17 TESTS 71 93 10649600 2800
57470986 walnutwaldo20 E July 21, 2019, 6:10 p.m. OK GNU C++17 TESTS 72 108 1228800 2800
54456559 neal E May 21, 2019, 4:12 p.m. OK GNU C++17 TESTS 72 108 2457600 2800
53943594 Lawali E May 10, 2019, 5:05 a.m. OK GNU C++17 TESTS 71 108 3379200 2800
54096159 zhishou E May 14, 2019, 1:09 p.m. OK Java 8 TESTS 72 217 0 2800
53941535 dalt E May 10, 2019, 3:25 a.m. OK Java 8 TESTS 71 280 9113600 2800
54648145 Oopsimbad E May 26, 2019, 3 a.m. OK Java 8 TESTS 72 327 19456000 2800
53940596 uwi E May 10, 2019, 2:41 a.m. OK Java 8 TESTS 71 452 0 2800
54427538 martins E May 20, 2019, 7:30 p.m. OK Java 8 TESTS 72 467 38400000 2800
54423833 TrabajoNocturno E May 20, 2019, 5:04 p.m. OK Mono C# TESTS 72 218 98918400 2800
54271418 llmxby E May 17, 2019, 8:56 a.m. OK MS C++ 2017 TESTS 72 139 3174400 2800
55394451 Atlasmoth E June 10, 2019, 11:10 a.m. OK MS C++ 2017 TESTS 72 950 47308800 2800
53926352 whatshisbucket E May 9, 2019, 4:40 p.m. OK Python 3 TESTS 71 780 32358400 2800

remove filters

Back to search problems