Codeforces Round 769 (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
1632 Codeforces Round 769 (Div. 2) FINISHED False 7200 93626663 Jan. 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23234 ) B Roof Construction PROGRAMMING bitmasks constructive algorithms

B'It has finally been decided to build a roof over the football field in School 179. Its construction will require placing n consecutive vertical pillars. Furthermore, the headmaster wants the heights of all the pillars to form a permutation p of integers from 0 to n - 1 , where p_i is the height of the i -th pillar from the left (1 <= i <= n) . As the chief, you know that the cost of construction of consecutive pillars is equal to the maximum value of the bitwise XOR of heights of all pairs of adjacent pillars. In other words, the cost of construction is equal to max limits_{1 <= i <= n - 1}{p_i oplus p_{i + 1}} , where oplus denotes the bitwise XOR operation. Find any sequence of pillar heights p of length n with the smallest construction cost. In this problem, a permutation is an array consisting of n distinct integers from 0 to n - 1 in arbitrary order. For example, [2,3,1,0,4] is a permutation, but [1,0,1] is not a permutation ( 1 appears twice in the array) and [1,0,3] is also not a permutation ( n=3 , but 3 is in the array). Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The only line for each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of pillars for the construction of the roof. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case print n integers p_1 , p_2 , ldots , p_n -- the sequence of pillar heights with the smallest construction cost. If there are multiple answers, print any of them. For n = 2 there are 2 sequences of pillar heights: For n = 3 there are 6 sequences of pillar heights: '...

Tutorials

Editorial of Codeforces Round #769

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
144610775 pecksniff B Jan. 31, 2022, 4:18 a.m. OK Clang++17 Diagnostics TESTS 20 685 0
144594578 Sankalp_12 B Jan. 30, 2022, 6:59 p.m. OK GNU C11 TESTS 20 780 0
144590321 1435730 B Jan. 30, 2022, 6:01 p.m. OK GNU C11 TESTS 20 795 0
144603171 Murli_33 B Jan. 30, 2022, 11:04 p.m. OK GNU C11 TESTS 20 795 1638400
144587322 shirish2601 B Jan. 30, 2022, 5:32 p.m. OK GNU C11 TESTS 20 810 0
144579053 pj_2103 B Jan. 30, 2022, 4:27 p.m. OK GNU C11 TESTS 20 842 0
144585007 rainboy B Jan. 30, 2022, 5:16 p.m. OK GNU C11 TESTS 20 889 0
144595113 ranjoy_456 B Jan. 30, 2022, 7:08 p.m. OK GNU C++14 TESTS 20 31 0
144609439 fighterkong B Jan. 31, 2022, 3:48 a.m. OK GNU C++14 TESTS 20 31 0
144608488 bhushankolpe561 B Jan. 31, 2022, 3:24 a.m. OK GNU C++14 TESTS 20 31 0
144607590 towardsInfinity B Jan. 31, 2022, 2:58 a.m. OK GNU C++14 TESTS 20 31 0
144605932 binarypain B Jan. 31, 2022, 1:57 a.m. OK GNU C++14 TESTS 20 31 0
144603538 IsmailToukhy B Jan. 30, 2022, 11:28 p.m. OK GNU C++14 TESTS 20 31 0
144600353 suriyaa_13 B Jan. 30, 2022, 9:01 p.m. OK GNU C++14 TESTS 20 31 0
144595158 obaydullahmhs B Jan. 30, 2022, 7:09 p.m. OK GNU C++14 TESTS 20 31 0
144611713 WzhDnwzWzh B Jan. 31, 2022, 4:35 a.m. OK GNU C++14 TESTS 20 31 0
144610089 empaktus B Jan. 31, 2022, 4:03 a.m. OK GNU C++14 TESTS 20 31 0
144614580 devansh52 B Jan. 31, 2022, 5:24 a.m. OK GNU C++17 TESTS 20 31 0
144614361 2020BNUAIer B Jan. 31, 2022, 5:21 a.m. OK GNU C++17 TESTS 20 31 0
144614279 jaybhade B Jan. 31, 2022, 5:20 a.m. OK GNU C++17 TESTS 20 31 0
144613693 aditya_04 B Jan. 31, 2022, 5:11 a.m. OK GNU C++17 TESTS 20 31 0
144613098 _no_mercy B Jan. 31, 2022, 5:01 a.m. OK GNU C++17 TESTS 20 31 0
144612057 niuzhenhua B Jan. 31, 2022, 4:41 a.m. OK GNU C++17 TESTS 20 31 0
144614428 rahulladi8686 B Jan. 31, 2022, 5:22 a.m. OK GNU C++17 TESTS 20 31 0
144615152 ankitmaurya_19 B Jan. 31, 2022, 5:33 a.m. OK GNU C++17 TESTS 20 31 0
144615985 stevenzhang B Jan. 31, 2022, 5:46 a.m. OK GNU C++17 TESTS 20 31 0
144614837 agrawalpiyush B Jan. 31, 2022, 5:28 a.m. OK GNU C++17 TESTS 20 31 0
144612736 yashmnc B Jan. 31, 2022, 4:55 a.m. OK GNU C++17 (64) TESTS 20 30 0
144612444 linxd B Jan. 31, 2022, 4:49 a.m. OK GNU C++17 (64) TESTS 20 31 0
144615232 startrek4 B Jan. 31, 2022, 5:34 a.m. OK GNU C++17 (64) TESTS 20 31 0
144614218 Rajdep_Roy B Jan. 31, 2022, 5:19 a.m. OK GNU C++17 (64) TESTS 20 31 0
144613872 Retired_Isaunoya B Jan. 31, 2022, 5:14 a.m. OK GNU C++17 (64) TESTS 20 31 0
144613863 LittleCube B Jan. 31, 2022, 5:14 a.m. OK GNU C++17 (64) TESTS 20 31 0
144613279 anil_1 B Jan. 31, 2022, 5:04 a.m. OK GNU C++17 (64) TESTS 20 31 0
144613223 fr1234 B Jan. 31, 2022, 5:03 a.m. OK GNU C++17 (64) TESTS 20 31 0
144611032 binminh01 B Jan. 31, 2022, 4:22 a.m. OK GNU C++17 (64) TESTS 20 31 0
144610264 Prithvi_Rajan B Jan. 31, 2022, 4:07 a.m. OK GNU C++17 (64) TESTS 20 31 0
144608326 moday_morning B Jan. 31, 2022, 3:19 a.m. OK GNU C++20 (64) TESTS 20 15 0
144606992 Zaid_25 B Jan. 31, 2022, 2:37 a.m. OK GNU C++20 (64) TESTS 20 15 0
144605134 qhnana7mi B Jan. 31, 2022, 1:11 a.m. OK GNU C++20 (64) TESTS 20 15 0
144599248 Dipankar_Kumar_Singh B Jan. 30, 2022, 8:29 p.m. OK GNU C++20 (64) TESTS 20 15 0
144599205 Dipankar_Kumar_Singh B Jan. 30, 2022, 8:29 p.m. OK GNU C++20 (64) TESTS 20 15 0
144598891 Harsha221B B Jan. 30, 2022, 8:21 p.m. OK GNU C++20 (64) TESTS 20 15 0
144609750 Akib_12 B Jan. 31, 2022, 3:55 a.m. OK GNU C++20 (64) TESTS 20 15 0
144610402 Lazy1402 B Jan. 31, 2022, 4:10 a.m. OK GNU C++20 (64) TESTS 20 15 0
144613292 shmad B Jan. 31, 2022, 5:04 a.m. OK GNU C++20 (64) TESTS 20 15 0
144613349 yagnesh_1406 B Jan. 31, 2022, 5:05 a.m. OK GNU C++20 (64) TESTS 20 15 0
144589115 koqo B Jan. 30, 2022, 5:49 p.m. OK Go TESTS 20 46 1843200
144606511 unfixedbug B Jan. 31, 2022, 2:20 a.m. OK Java 11 TESTS 20 187 0
144594459 akashkumarkly B Jan. 30, 2022, 6:57 p.m. OK Java 11 TESTS 20 202 0
144616333 __Serendipity B Jan. 31, 2022, 5:51 a.m. OK Java 11 TESTS 20 202 0
144616200 vijender_8601 B Jan. 31, 2022, 5:49 a.m. OK Java 11 TESTS 20 202 0
144612339 shivam01_0 B Jan. 31, 2022, 4:47 a.m. OK Java 11 TESTS 20 202 0
144608985 Kumaresh B Jan. 31, 2022, 3:36 a.m. OK Java 11 TESTS 20 202 0
144600600 codebook_2000 B Jan. 30, 2022, 9:08 p.m. OK Java 11 TESTS 20 202 0
144599680 anjroo B Jan. 30, 2022, 8:42 p.m. OK Java 11 TESTS 20 202 0
144591306 tushar19280 B Jan. 30, 2022, 6:13 p.m. OK Java 11 TESTS 20 202 0
144578446 yadatisaiviswas3 B Jan. 30, 2022, 4:25 p.m. OK Java 11 TESTS 20 202 0
144612981 Koka B Jan. 31, 2022, 4:59 a.m. OK Java 8 TESTS 20 124 0
144596650 DEMO23 B Jan. 30, 2022, 7:36 p.m. OK Java 8 TESTS 20 124 0
144595971 niknaks B Jan. 30, 2022, 7:23 p.m. OK Java 8 TESTS 20 124 0
144590992 Karakurik B Jan. 30, 2022, 6:09 p.m. OK Java 8 TESTS 20 124 0
144588258 gagan_6730 B Jan. 30, 2022, 5:40 p.m. OK Java 8 TESTS 20 124 2457600
144575303 Onkar_ B Jan. 30, 2022, 4:18 p.m. OK Java 8 TESTS 20 124 2457600
144597861 O_E B Jan. 30, 2022, 8 p.m. OK Java 8 TESTS 20 139 0
144609490 toufique_husein B Jan. 31, 2022, 3:49 a.m. OK Java 8 TESTS 20 170 0
144580165 vgrechko B Jan. 30, 2022, 4:29 p.m. OK Java 8 TESTS 20 249 16793600
144587344 kasyu B Jan. 30, 2022, 5:32 p.m. OK Java 8 TESTS 20 326 0
144590370 itmosha B Jan. 30, 2022, 6:02 p.m. OK MS C++ 2017 TESTS 20 109 0
144606806 RealStarlight B Jan. 31, 2022, 2:30 a.m. OK MS C++ 2017 TESTS 20 124 0
144576219 Vadigar B Jan. 30, 2022, 4:20 p.m. OK MS C++ 2017 TESTS 20 124 819200
144581357 .rong. B Jan. 30, 2022, 4:32 p.m. OK MS C++ 2017 TESTS 20 124 921600
144576284 Mysticode B Jan. 30, 2022, 4:20 p.m. OK MS C++ 2017 TESTS 20 124 1740800
144613523 pecksniff B Jan. 31, 2022, 5:08 a.m. OK MS C++ 2017 TESTS 20 140 0
144586282 mishra-aayush B Jan. 30, 2022, 5:24 p.m. OK MS C++ 2017 TESTS 20 140 0
144597564 fatant B Jan. 30, 2022, 7:54 p.m. OK MS C++ 2017 TESTS 20 140 3276800
144613487 pecksniff B Jan. 31, 2022, 5:07 a.m. OK MS C++ 2017 TESTS 20 155 0
144611046 pecksniff B Jan. 31, 2022, 4:23 a.m. OK MS C++ 2017 TESTS 20 155 0
144599286 suraj B Jan. 30, 2022, 8:30 p.m. OK .NET Core C# TESTS 20 124 11673600
144596809 Togstation B Jan. 30, 2022, 7:39 p.m. OK .NET Core C# TESTS 20 139 11468800
144585559 1_2_3_4_5_9 B Jan. 30, 2022, 5:19 p.m. OK PyPy 2 TESTS 20 171 5632000
144599406 nhipata B Jan. 30, 2022, 8:34 p.m. OK PyPy 2 TESTS 20 248 7475200
144589717 patulka B Jan. 30, 2022, 5:55 p.m. OK PyPy 3 TESTS 20 202 15360000
144576923 Mr._Oogway B Jan. 30, 2022, 4:22 p.m. OK PyPy 3 TESTS 20 233 8908800
144593720 MistaAsh B Jan. 30, 2022, 6:46 p.m. OK PyPy 3 TESTS 20 233 13824000
144577028 grisme B Jan. 30, 2022, 4:22 p.m. OK PyPy 3 TESTS 20 248 19353600
144574806 avkonyahin B Jan. 30, 2022, 4:17 p.m. OK PyPy 3 TESTS 20 280 17203200
144611308 Preetmodh_13 B Jan. 31, 2022, 4:27 a.m. OK PyPy 3 TESTS 20 295 11776000
144609402 majay1638 B Jan. 31, 2022, 3:47 a.m. OK PyPy 3 TESTS 20 327 10752000
144574374 singh.tarun.iit B Jan. 30, 2022, 4:16 p.m. OK PyPy 3 TESTS 20 342 13004800
144581408 anuragmuthyala11 B Jan. 30, 2022, 4:32 p.m. OK PyPy 3 TESTS 20 343 14848000
144612495 saurabh3195 B Jan. 31, 2022, 4:50 a.m. OK PyPy 3 TESTS 20 358 14233600
144585748 FlakeLCR B Jan. 30, 2022, 5:20 p.m. OK PyPy 3-64 TESTS 20 186 12800000
144581391 DarkHorse_it_iz B Jan. 30, 2022, 4:32 p.m. OK PyPy 3-64 TESTS 20 202 12492800
144596457 Multibala B Jan. 30, 2022, 7:32 p.m. OK PyPy 3-64 TESTS 20 233 18739200
144596073 Multibala B Jan. 30, 2022, 7:24 p.m. OK PyPy 3-64 TESTS 20 233 18739200
144595252 oadey89 B Jan. 30, 2022, 7:10 p.m. OK PyPy 3-64 TESTS 20 233 21196800
144580031 Eyara B Jan. 30, 2022, 4:29 p.m. OK PyPy 3-64 TESTS 20 234 13107200
144589461 AbnerShen B Jan. 30, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 20 280 23552000
144589363 AbnerShen B Jan. 30, 2022, 5:51 p.m. OK PyPy 3-64 TESTS 20 311 19865600
144595290 evoxtorm B Jan. 30, 2022, 7:11 p.m. OK PyPy 3-64 TESTS 20 358 11878400
144606809 _Shubham B Jan. 31, 2022, 2:31 a.m. OK PyPy 3-64 TESTS 20 358 18022400
144598819 OLOGY B Jan. 30, 2022, 8:19 p.m. OK Python 2 TESTS 20 77 12288000
144590067 joshspchang B Jan. 30, 2022, 5:59 p.m. OK Python 3 TESTS 20 202 10240000
144611079 shubham1292000 B Jan. 31, 2022, 4:23 a.m. OK Python 3 TESTS 20 311 4812800
144582200 gabrielrocha B Jan. 30, 2022, 4:33 p.m. OK Python 3 TESTS 20 311 5734400
144593997 OneBit74 B Jan. 30, 2022, 6:50 p.m. OK Python 3 TESTS 20 312 4710400
144578885 Priyansh_Mali18 B Jan. 30, 2022, 4:26 p.m. OK Python 3 TESTS 20 327 204800
144613050 Srirambabu B Jan. 31, 2022, 5 a.m. OK Python 3 TESTS 20 327 5529600
144575557 saksh2410 B Jan. 30, 2022, 4:18 p.m. OK Python 3 TESTS 20 327 5529600
144587217 arjit_0602 B Jan. 30, 2022, 5:31 p.m. OK Python 3 TESTS 20 327 6144000
144588469 gouravtiwari237 B Jan. 30, 2022, 5:43 p.m. OK Python 3 TESTS 20 342 204800
144588479 satyamshrma B Jan. 30, 2022, 5:43 p.m. OK Python 3 TESTS 20 342 6144000
144615142 palilo B Jan. 31, 2022, 5:33 a.m. OK Rust 2021 TESTS 20 15 102400
144581729 Romal_Vekasi B Jan. 30, 2022, 4:33 p.m. OK Scala TESTS 20 654 11366400

remove filters

Back to search problems