Codeforces Round 1075 (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
2189 Codeforces Round 1075 (Div. 2) FINISHED False 7200 7226723 Jan. 23, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 13730 ) C1 XOR Convenience (Easy Version) PROGRAMMING bitmasks brute force constructive algorithms math

This is the easy version of the problem. The difference between the versions is that in this version, (2 \le i \le n-1). Note that a correct solution for the hard version is not necessarily a correct solution for the easy version. Given a natural number (n). Find a permutation(^{\text{∗}}) (p) of length (n), such that for each (i) ((\style{color:red}{2 \le i \le n-1})) there exists a (j) ((\style{color:red}{i \le j \le n})) such that (p_i = p_j \oplus i) (^{\text{†}}). It can be proven that under the constraints of the problem, there exists at least one suitable permutation (p). (^{\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{†}})(\oplus) denotes the bitwise XOR operation . Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The only line of each test case contains a single integer (n) ((3 \leq n \leq 2 \cdot 10^5)) — the length of the permutation. It is guaranteed that the sum of (n) across all test cases does not exceed (2\cdot 10^5). For each test case, output (n) integers (p_1,p_2,\ldots,p_n) — the permutation (p). If there are multiple solutions, you may output any of them. In the first test case, the permutation (p = 2,1,3) is suitable since (p_2 = 1) and (p_3 \oplus 2 = 1). In the second test case, the permutation (p = 3,6,2,5,1,4) is suitable, as: (p_2 = 6 = 4 \oplus 2 = p_6 \oplus 2) (p_3 = 2 = 1 \oplus 3 = p_5 \oplus 3) (p_4 = 5 = 1 \oplus 4 = p_5 \oplus 4) (p_5 = 1 = 4 \oplus 5 = p_6 \oplus 5)

Tutorials

Codeforces Round 1075 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359473640 18Pavan C1 Jan. 23, 2026, 8:36 p.m. OK C++17 (GCC 7-32) TESTS 10 31 102400
359456740 lastlife C1 Jan. 23, 2026, 5:52 p.m. OK C++17 (GCC 7-32) TESTS 10 31 102400
359498665 heisenpeak..123 C1 Jan. 24, 2026, 5:18 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359493031 zjwwjhy C1 Jan. 24, 2026, 4:13 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359484319 Elaine-Wangyiran C1 Jan. 24, 2026, 1:11 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359482755 shanmukh_123 C1 Jan. 24, 2026, 12:21 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359474799 wengle123 C1 Jan. 23, 2026, 8:55 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359471791 aditya_g3 C1 Jan. 23, 2026, 8:12 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359467607 Indoraptor777 C1 Jan. 23, 2026, 7:23 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359467270 i_qwed C1 Jan. 23, 2026, 7:20 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
359500998 AlexTolstov C1 Jan. 24, 2026, 5:37 a.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359483110 BlueMoon. C1 Jan. 24, 2026, 12:33 a.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359474251 Chiru_Ch C1 Jan. 23, 2026, 8:46 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359457658 Mohammed_Nasserr C1 Jan. 23, 2026, 5:59 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359450217 hengliao C1 Jan. 23, 2026, 5:10 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359449770 stellarStack C1 Jan. 23, 2026, 5:08 p.m. OK C++20 (GCC 13-64) TESTS 10 31 0
359489689 homeBoy C1 Jan. 24, 2026, 3:13 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
359489193 yuanmouren C1 Jan. 24, 2026, 3:04 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
359482740 Westxrn C1 Jan. 24, 2026, 12:20 a.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
359479321 tarunnnnn C1 Jan. 23, 2026, 10:28 p.m. OK C++20 (GCC 13-64) TESTS 10 31 102400
359497530 uv69 C1 Jan. 24, 2026, 5:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359504926 drakonov C1 Jan. 24, 2026, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359504733 Aaryan-Modi C1 Jan. 24, 2026, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359503406 veermanawat2006 C1 Jan. 24, 2026, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359503380 teaegg C1 Jan. 24, 2026, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359491856 H19wk C1 Jan. 24, 2026, 3:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359491410 P_A C1 Jan. 24, 2026, 3:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359490147 shiki- C1 Jan. 24, 2026, 3:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359489171 krish_0108 C1 Jan. 24, 2026, 3:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359486333 waszz123456 C1 Jan. 24, 2026, 2:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 0
359485967 ruban C1 Jan. 24, 2026, 1:56 a.m. OK FPC TESTS 10 156 56627200
359466952 Coderhacks16 C1 Jan. 23, 2026, 7:17 p.m. OK GNU C11 TESTS 10 812 819200
359441333 new_leading C1 Jan. 23, 2026, 4:27 p.m. OK GNU C11 TESTS 10 937 819200
359449179 EndlessZheng C1 Jan. 23, 2026, 5:06 p.m. OK Go TESTS 10 46 4812800
359490033 chethan_coding C1 Jan. 24, 2026, 3:19 a.m. OK Go TESTS 10 93 17100800
359443530 stevie1024 C1 Jan. 23, 2026, 4:30 p.m. OK Haskell TESTS 10 312 17817600
359487055 Greatest789 C1 Jan. 24, 2026, 2:24 a.m. OK Java 21 TESTS 10 218 614400
359464756 fatal-98 C1 Jan. 23, 2026, 6:55 p.m. OK Java 21 TESTS 10 218 716800
359471047 ghost_248 C1 Jan. 23, 2026, 8:03 p.m. OK Java 21 TESTS 10 218 1331200
359439867 kit28.24bec094 C1 Jan. 23, 2026, 4:24 p.m. OK Java 21 TESTS 10 234 307200
359458208 SCOOBY C1 Jan. 23, 2026, 6:03 p.m. OK Java 21 TESTS 10 234 614400
359439837 ramuttang C1 Jan. 23, 2026, 4:24 p.m. OK Java 21 TESTS 10 234 921600
359491104 vpinmrcool C1 Jan. 24, 2026, 3:40 a.m. OK Java 21 TESTS 10 234 1024000
359462801 prerana_1621 C1 Jan. 23, 2026, 6:37 p.m. OK Java 21 TESTS 10 250 716800
359486835 SathyaRoopanM C1 Jan. 24, 2026, 2:19 a.m. OK Java 21 TESTS 10 265 614400
359440111 mastacoda C1 Jan. 23, 2026, 4:24 p.m. OK Java 21 TESTS 10 265 1126400
359477726 Vishmiya_61 C1 Jan. 23, 2026, 9:50 p.m. OK Java 8 TESTS 10 140 3174400
359442002 kit27.bme03 C1 Jan. 23, 2026, 4:28 p.m. OK Java 8 TESTS 10 140 3174400
359446244 Priyadharshiniii C1 Jan. 23, 2026, 4:34 p.m. OK Java 8 TESTS 10 156 3174400
359443944 madhu9618 C1 Jan. 23, 2026, 4:31 p.m. OK Java 8 TESTS 10 171 0
359440093 abhayrajnegi0416 C1 Jan. 23, 2026, 4:24 p.m. OK Java 8 TESTS 10 234 10547200
359473580 public-static-void-main C1 Jan. 23, 2026, 8:36 p.m. OK Java 8 TESTS 10 250 16896000
359476420 divyanshvijay079 C1 Jan. 23, 2026, 9:25 p.m. OK Java 8 TESTS 10 281 0
359446465 jayasrishanmathi C1 Jan. 23, 2026, 4:34 p.m. OK Java 8 TESTS 10 281 0
359451748 kevin_0911 C1 Jan. 23, 2026, 5:18 p.m. OK Java 8 TESTS 10 312 0
359445642 HariomTiwari01 C1 Jan. 23, 2026, 4:33 p.m. OK Java 8 TESTS 10 312 0
359480472 tin.le2 C1 Jan. 23, 2026, 11:02 p.m. OK Kotlin 1.7 TESTS 10 375 39424000
359457995 crucious C1 Jan. 23, 2026, 6:01 p.m. OK PyPy 3 TESTS 10 218 11366400
359444000 grumax C1 Jan. 23, 2026, 4:31 p.m. OK PyPy 3 TESTS 10 250 13414400
359467110 Arvind215271 C1 Jan. 23, 2026, 7:19 p.m. OK PyPy 3 TESTS 10 328 9318400
359487431 kaushik.atla C1 Jan. 24, 2026, 2:31 a.m. OK PyPy 3-64 TESTS 10 62 12697600
359454016 tutel2157 C1 Jan. 23, 2026, 5:33 p.m. OK PyPy 3-64 TESTS 10 78 8192000
359496877 sharmaujjwal5706 C1 Jan. 24, 2026, 5:02 a.m. OK PyPy 3-64 TESTS 10 78 11161600
359444148 Luccarodriguezk C1 Jan. 23, 2026, 4:31 p.m. OK PyPy 3-64 TESTS 10 93 9420800
359475154 masao C1 Jan. 23, 2026, 9:01 p.m. OK PyPy 3-64 TESTS 10 93 13516800
359469503 EmeraldBeast C1 Jan. 23, 2026, 7:45 p.m. OK PyPy 3-64 TESTS 10 93 13516800
359460590 golomb C1 Jan. 23, 2026, 6:20 p.m. OK PyPy 3-64 TESTS 10 93 13516800
359457999 rishivk_144 C1 Jan. 23, 2026, 6:01 p.m. OK PyPy 3-64 TESTS 10 93 13516800
359456199 MinValgen C1 Jan. 23, 2026, 5:48 p.m. OK PyPy 3-64 TESTS 10 93 13516800
359470997 Jyotier C1 Jan. 23, 2026, 8:02 p.m. OK PyPy 3-64 TESTS 10 93 15462400
359446565 NullNCoder C1 Jan. 23, 2026, 4:34 p.m. OK Python 3 TESTS 10 109 31539200
359443805 rajeevranjan8863 C1 Jan. 23, 2026, 4:31 p.m. OK Python 3 TESTS 10 156 20889600
359450537 TwinkleAI C1 Jan. 23, 2026, 5:12 p.m. OK Python 3 TESTS 10 218 11468800
359477292 henry-db C1 Jan. 23, 2026, 9:41 p.m. OK Python 3 TESTS 10 218 12902400
359441528 gifted_kiko C1 Jan. 23, 2026, 4:27 p.m. OK Python 3 TESTS 10 218 31539200
359441995 Cheesies C1 Jan. 23, 2026, 4:28 p.m. OK Python 3 TESTS 10 234 13619200
359440755 vats1011 C1 Jan. 23, 2026, 4:26 p.m. OK Python 3 TESTS 10 234 14028800
359442085 abhijeetmankani C1 Jan. 23, 2026, 4:28 p.m. OK Python 3 TESTS 10 250 11264000
359445244 Riyad27 C1 Jan. 23, 2026, 4:33 p.m. OK Python 3 TESTS 10 250 11468800
359444617 Smit1105 C1 Jan. 23, 2026, 4:32 p.m. OK Python 3 TESTS 10 265 11161600
359470642 charles0123 C1 Jan. 23, 2026, 7:58 p.m. OK Rust 2024 TESTS 10 46 0
359457305 quereant C1 Jan. 23, 2026, 5:56 p.m. OK Rust 2024 TESTS 10 46 0

remove filters

Back to search problems