Codeforces Round 1071 (Div. 3)

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
2179 Codeforces Round 1071 (Div. 3) FINISHED False 9000 9904523 Dec. 23, 2025, 2:45 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 13361 ) D Blackslex and Penguin Civilization PROGRAMMING bitmasks constructive algorithms greedy math

Penguins are civilized creatures that communicate using permutations. Blackslex, as a penguin researcher, must study their means of communication. For a given integer (n), consider permutations(^{\text{∗}}) (p) of the array (0, 1, \ldots, 2^n - 1). Define ()S(p) \;=\; \sum_{i=0}^{2^n-1} \operatorname{popcount}\!\bigl(p_0 \mathbin{\&} p_1 \mathbin{\&} \cdots \mathbin{\&} p_i\bigr),() where (\operatorname{popcount}(z)) is the number of (1)-bits in the binary representation of (z) (for instance, (\operatorname{popcount}(5) = 2) because (5 = 101_2) has two (1)-bits in the binary representation), and (\&) denotes the bitwise AND operation . . A permutation is considered sacred if it maximizes (S(p)). Find the lexicographically minimal (^{\text{†}}) sacred permutation. (^{\text{∗}})A permutation of length (n) is an array consisting of (n) distinct integers from (1) to (n) in arbitrary order. For example, (2,3,1,5,4) is a permutation, but (1,2,2) is not a permutation ((2) appears twice in the array), and (1,3,4) is also not a permutation ((n=3) but there is (4) in the array). (^{\text{†}})An array (a) is lexicographically smaller than an array (b) of the same size if and only if the following holds: in the first position where (a) and (b) differ, the array (a) has a smaller element than the corresponding element in (b). The first line contains a single integer (t) ((1 \le t \le 16)) — the number of test cases. Each test case contains a single integer (n) ((1 \le n \le 16)). It is guaranteed that the sum of (2^n) over all test cases does not exceed (2^{16}). For each test case, output (2^n) integers (p_0, p_1, \ldots, p_{2^n-1}) — the required permutation. For the first test case, there are two possible permutations. (p = 0, 1), (S(p) = 0) (p = 1, 0), (S(p) = 1) For the secon

Tutorials

Codeforces Round 1071 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
354948266 fanistgg D Dec. 24, 2025, 1:53 p.m. OK C++17 (GCC 7-32) TESTS 3 0 0
355009762 ZJUT_lx D Dec. 25, 2025, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
355006245 azureeee D Dec. 25, 2025, 4:43 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354983697 mayankhere567 D Dec. 24, 2025, 7:10 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354978432 Ghanshyam007 D Dec. 24, 2025, 6:12 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354974716 pranav9354 D Dec. 24, 2025, 5:35 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354963868 _puN_puN_ D Dec. 24, 2025, 3:55 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354956213 tmiemie D Dec. 24, 2025, 2:54 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354955850 yntcdd D Dec. 24, 2025, 2:51 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
354950965 Krish_garg198 D Dec. 24, 2025, 2:13 p.m. OK C++17 (GCC 7-32) TESTS 3 15 0
355008317 WFeng D Dec. 25, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
355001222 Spectr_l D Dec. 25, 2025, 2:34 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354982772 god_harsh D Dec. 24, 2025, 6:58 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354972481 alice19 D Dec. 24, 2025, 5:14 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354971782 levi__k D Dec. 24, 2025, 5:08 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354970535 Onicito D Dec. 24, 2025, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354968790 tarek14 D Dec. 24, 2025, 4:38 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354954318 nurikgod D Dec. 24, 2025, 2:39 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354953790 Kshitij62 D Dec. 24, 2025, 2:35 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
354951433 alex.rozhkov.by D Dec. 24, 2025, 2:16 p.m. OK C++20 (GCC 13-64) TESTS 3 15 0
355006484 koderabhishek D Dec. 25, 2025, 4:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
355002227 guptafactory D Dec. 25, 2025, 3:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354999074 GILGAMESH D Dec. 25, 2025, 1:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354995292 Mxrio7 D Dec. 24, 2025, 10:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354991589 Domzi1 D Dec. 24, 2025, 9:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354980062 pulkit1078 D Dec. 24, 2025, 6:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354978724 AHOURA2010R D Dec. 24, 2025, 6:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354976875 qasimbatrawi D Dec. 24, 2025, 5:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354975487 Adrenaline_00 D Dec. 24, 2025, 5:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354973488 ahnaf.hasan.mahmud D Dec. 24, 2025, 5:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 15 0
354950426 crazyesjavahater D Dec. 24, 2025, 2:09 p.m. OK GNU C11 TESTS 3 265 0
354923386 codeitup544 D Dec. 24, 2025, 10:45 a.m. OK GNU C11 TESTS 3 265 102400
354947651 hash123 D Dec. 24, 2025, 1:49 p.m. OK GNU C11 TESTS 3 281 0
354999147 Ritwin D Dec. 25, 2025, 1:23 a.m. OK GNU C11 TESTS 3 281 307200
354998433 Zongb D Dec. 25, 2025, 12:53 a.m. OK GNU C11 TESTS 3 296 102400
354884635 bridgekiller D Dec. 24, 2025, 4:15 a.m. OK Go TESTS 3 15 1126400
354882009 dzhi D Dec. 24, 2025, 3:27 a.m. OK Java 21 TESTS 3 140 102400
354877031 heromanba D Dec. 24, 2025, 1:20 a.m. OK Java 21 TESTS 3 140 614400
354916571 beatinghu D Dec. 24, 2025, 9:49 a.m. OK Java 21 TESTS 3 171 307200
354925587 godAngryOver D Dec. 24, 2025, 11:03 a.m. OK Java 21 TESTS 3 171 409600
354937479 rajganatra045 D Dec. 24, 2025, 12:34 p.m. OK Java 21 TESTS 3 171 614400
354877316 heromanba D Dec. 24, 2025, 1:31 a.m. OK Java 21 TESTS 3 171 716800
354883901 Adhikkesh D Dec. 24, 2025, 4:03 a.m. OK Java 21 TESTS 3 187 102400
354872433 Abhishek_Yadav123 D Dec. 23, 2025, 10:32 p.m. OK Java 21 TESTS 3 187 204800
354892255 vin_contra D Dec. 24, 2025, 6:08 a.m. OK Java 21 TESTS 3 218 0
354887879 NpHardcore_05 D Dec. 24, 2025, 5:07 a.m. OK Java 21 TESTS 3 218 204800
354881360 prime29 D Dec. 24, 2025, 3:14 a.m. OK Java 8 TESTS 3 93 0
354928593 abhi139 D Dec. 24, 2025, 11:26 a.m. OK Java 8 TESTS 3 125 0
354989924 vootkuriakshayreddy D Dec. 24, 2025, 8:37 p.m. OK Java 8 TESTS 3 140 0
354911230 AchalVishnoi D Dec. 24, 2025, 9:08 a.m. OK Java 8 TESTS 3 140 0
354910853 public-static-void-main D Dec. 24, 2025, 9:05 a.m. OK Java 8 TESTS 3 140 16896000
354932649 kidus72 D Dec. 24, 2025, 11:58 a.m. OK Java 8 TESTS 3 156 0
354943554 abhi... D Dec. 24, 2025, 1:20 p.m. OK Java 8 TESTS 3 203 0
354911476 WbxOne D Dec. 24, 2025, 9:10 a.m. OK Node.js TESTS 3 62 8908800
354966893 madunagu D Dec. 24, 2025, 4:21 p.m. OK Node.js TESTS 3 78 8499200
354996979 gaerrymacroc D Dec. 24, 2025, 11:48 p.m. OK PyPy 3 TESTS 3 125 6246400
354997734 LoNarD02 D Dec. 25, 2025, 12:21 a.m. OK PyPy 3 TESTS 3 125 9113600
355003090 liuxx D Dec. 25, 2025, 3:30 a.m. OK PyPy 3 TESTS 3 140 8908800
354949547 sarisht_shreshth D Dec. 24, 2025, 2:02 p.m. OK PyPy 3 TESTS 3 234 8396800
354987289 nakshatramandowara D Dec. 24, 2025, 7:58 p.m. OK PyPy 3-64 TESTS 3 31 6553600
354951028 gooonn D Dec. 24, 2025, 2:14 p.m. OK PyPy 3-64 TESTS 3 46 2969600
354882193 irya7386 D Dec. 24, 2025, 3:31 a.m. OK PyPy 3-64 TESTS 3 46 2969600
354873694 suTaamlFelCP D Dec. 23, 2025, 11:16 p.m. OK PyPy 3-64 TESTS 3 46 2969600
355003321 dieworld5432 D Dec. 25, 2025, 3:36 a.m. OK PyPy 3-64 TESTS 3 46 3276800
354882626 Emikooh D Dec. 24, 2025, 3:39 a.m. OK PyPy 3-64 TESTS 3 46 4608000
354980659 Xerxes_KC D Dec. 24, 2025, 6:32 p.m. OK PyPy 3-64 TESTS 3 46 5017600
354910454 Rajasekhar_Aravalam D Dec. 24, 2025, 9:01 a.m. OK PyPy 3-64 TESTS 3 46 6553600
354942255 coderrg21 D Dec. 24, 2025, 1:10 p.m. OK PyPy 3-64 TESTS 3 46 7065600
354935843 SkyHigh007 D Dec. 24, 2025, 12:23 p.m. OK PyPy 3-64 TESTS 3 46 7270400
354951178 MrYun123 D Dec. 24, 2025, 2:15 p.m. OK Python 3 TESTS 3 46 6963200
354917158 VSS402854MZaid D Dec. 24, 2025, 9:53 a.m. OK Python 3 TESTS 3 78 4505600
354950998 MrYun123 D Dec. 24, 2025, 2:13 p.m. OK Python 3 TESTS 3 78 6860800
354978813 Rjain02 D Dec. 24, 2025, 6:15 p.m. OK Python 3 TESTS 3 93 307200
354879115 gifted_kiko D Dec. 24, 2025, 2:24 a.m. OK Python 3 TESTS 3 93 307200
354889846 eugalt D Dec. 24, 2025, 5:33 a.m. OK Python 3 TESTS 3 93 3481600
354888439 eugalt D Dec. 24, 2025, 5:14 a.m. OK Python 3 TESTS 3 93 3481600
354999530 timeforfun D Dec. 25, 2025, 1:38 a.m. OK Python 3 TESTS 3 93 4300800
354999506 timeforfun D Dec. 25, 2025, 1:37 a.m. OK Python 3 TESTS 3 93 4300800
354889896 cosmicbloom D Dec. 24, 2025, 5:33 a.m. OK Python 3 TESTS 3 93 4300800
354883512 Spheniscine D Dec. 24, 2025, 3:57 a.m. OK Rust 2021 TESTS 3 31 0
354883346 Spheniscine D Dec. 24, 2025, 3:54 a.m. OK Rust 2021 TESTS 3 46 0

remove filters

Back to search problems