Codeforces Global Round 29 (Div. 1 + 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
2147 Codeforces Global Round 29 (Div. 1 + Div. 2) FINISHED False 10800 18113084 Sept. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 16847 ) B Multiple Construction PROGRAMMING constructive algorithms

You are given an integer (n). Your task is to construct an array of length (2 \cdot n) such that: Each integer from (1) to (n) appears exactly twice in the array. For each integer (x) ((1 \le x \le n)), the distance between the two occurrences of (x) is a multiple of (x). In other words, if (p_x) and (q_x) are the indices of the two occurrences of (x), (| q_x - p_x |) must be divisible by (x). It can be shown that a solution always exists. 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. Each of the next (t) lines contains a single integer (n) ((1 \le n \le 2 \cdot 10^{5})). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^{5}). For each test case, print a line containing (2 \cdot n) integers — the array that satisfies the given conditions. If there are multiple valid answers, print any of them. Visualizer link In the first test case: The number (1) appears at positions (1) and (3): the distance is (2), which is divisible by (1). The number (2) appears at positions (2) and (4): the distance is (2), which is divisible by (2). In the second test case: The number (1) appears at positions (1) and (3): the distance is (2), which is divisible by (1). The number (2) appears at positions (4) and (6): the distance is (2), which is divisible by (2). The number (3) appears at positions (2) and (5): the distance is (3), which is divisible by (3). In the third test case, the two occurrences of (1) are at positions (1) and (2), so the distance between them is (1), which is a multiple of (1).

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339655344 zheng0808 B Sept. 21, 2025, 5:52 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339653503 miaomiao02 B Sept. 21, 2025, 5:32 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339652461 Shubhanjali_0001 B Sept. 21, 2025, 5:21 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339650112 TanishqThuse B Sept. 21, 2025, 4:55 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339649101 hs.xx B Sept. 21, 2025, 4:38 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339647749 MYSTERIOU B Sept. 21, 2025, 4:20 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339642924 tomQian B Sept. 21, 2025, 2:50 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339640666 safwansatil B Sept. 21, 2025, 2:02 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339638617 dustdream B Sept. 21, 2025, 1:10 a.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339629302 Ashu_G2 B Sept. 20, 2025, 9:15 p.m. OK C++17 (GCC 7-32) TESTS 10 77 0
339648974 C47KIKI B Sept. 21, 2025, 4:36 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
339652182 SampsonYW B Sept. 21, 2025, 5:18 a.m. OK C++20 (GCC 13-64) TESTS 10 61 4096000
339656591 Yomaan B Sept. 21, 2025, 6:05 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339656186 aryanmishra12112003 B Sept. 21, 2025, 6:01 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339654549 DG_Wizard B Sept. 21, 2025, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339652930 Trilliverse B Sept. 21, 2025, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339652579 De-Moiver B Sept. 21, 2025, 5:22 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339652248 WangPaiwc B Sept. 21, 2025, 5:19 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339650580 om_galande B Sept. 21, 2025, 5:02 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339650378 secian_dip B Sept. 21, 2025, 4:59 a.m. OK C++20 (GCC 13-64) TESTS 10 62 0
339646396 maspy B Sept. 21, 2025, 3:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 3686400
339650611 blhxsdzjr B Sept. 21, 2025, 5:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
339648572 NOXJY B Sept. 21, 2025, 4:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
339647008 goddddgg B Sept. 21, 2025, 4:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
339640005 FrankGanius B Sept. 21, 2025, 1:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 1638400
339656455 SparkSTAR143 B Sept. 21, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
339653043 notfirst B Sept. 21, 2025, 5:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
339651807 crigz08 B Sept. 21, 2025, 5:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
339651741 ANUJ_0007 B Sept. 21, 2025, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
339651700 _Typhlosion B Sept. 21, 2025, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 0
339592449 soki1we123z B Sept. 20, 2025, 5 p.m. OK GNU C11 TESTS 10 92 5017600
339591411 k.saijaswanth B Sept. 20, 2025, 4:57 p.m. OK Go TESTS 10 92 5734400
339649402 ccj123 B Sept. 21, 2025, 4:44 a.m. OK Java 21 TESTS 10 296 1331200
339627016 shivansh_123 B Sept. 20, 2025, 8:49 p.m. OK Java 21 TESTS 10 296 4812800
339598239 Palindrome_kasak B Sept. 20, 2025, 5:18 p.m. OK Java 21 TESTS 10 296 6451200
339648300 singhzr B Sept. 21, 2025, 4:27 a.m. OK Java 21 TESTS 10 312 614400
339621851 dharahas B Sept. 20, 2025, 7:59 p.m. OK Java 21 TESTS 10 312 3788800
339601964 Aditya_17_08_04 B Sept. 20, 2025, 5:29 p.m. OK Java 21 TESTS 10 327 409600
339602611 sajjadahmeddd B Sept. 20, 2025, 5:31 p.m. OK Java 21 TESTS 10 358 7577600
339652385 NpHardcore_05 B Sept. 21, 2025, 5:20 a.m. OK Java 21 TESTS 10 359 4505600
339647332 lupunish B Sept. 21, 2025, 4:13 a.m. OK Java 21 TESTS 10 359 5222400
339596794 fatal-98 B Sept. 20, 2025, 5:13 p.m. OK Java 21 TESTS 10 374 921600
339592653 khemkaaditya48 B Sept. 20, 2025, 5:01 p.m. OK Java 8 TESTS 10 202 0
339637264 Raghvendra7415 B Sept. 21, 2025, 12:29 a.m. OK Java 8 TESTS 10 217 0
339620784 sarthaKKharKa_18 B Sept. 20, 2025, 7:50 p.m. OK Java 8 TESTS 10 218 0
339630790 multibagger B Sept. 20, 2025, 9:34 p.m. OK Java 8 TESTS 10 233 0
339600191 prateek15 B Sept. 20, 2025, 5:23 p.m. OK Java 8 TESTS 10 249 0
339592028 pannalapranay1406 B Sept. 20, 2025, 4:59 p.m. OK Java 8 TESTS 10 249 13516800
339619449 jatin310 B Sept. 20, 2025, 7:39 p.m. OK Java 8 TESTS 10 686 0
339650544 yamunesh2005 B Sept. 21, 2025, 5:01 a.m. OK Java 8 TESTS 10 687 0
339626113 Abhishek_Yadav123 B Sept. 20, 2025, 8:40 p.m. OK Java 8 TESTS 10 702 0
339654494 yallappaJ B Sept. 21, 2025, 5:43 a.m. OK Java 8 TESTS 10 718 0
339595794 alexey.enkov B Sept. 20, 2025, 5:10 p.m. OK Kotlin 1.9 TESTS 10 202 16793600
339644011 A_23 B Sept. 21, 2025, 3:11 a.m. OK Kotlin 1.9 TESTS 10 296 19353600
339595859 _Zuno_ B Sept. 20, 2025, 5:10 p.m. OK Node.js TESTS 10 249 69120000
339589925 NinepointEight B Sept. 20, 2025, 4:53 p.m. OK Node.js TESTS 10 280 38912000
339634066 Determinist B Sept. 20, 2025, 10:39 p.m. OK PHP TESTS 10 514 29388800
339640915 archittect B Sept. 21, 2025, 2:08 a.m. OK PyPy 3 TESTS 10 311 23552000
339617753 utsab77 B Sept. 20, 2025, 7:25 p.m. OK PyPy 3 TESTS 10 327 23347200
339639397 gopikrishna9968 B Sept. 21, 2025, 1:32 a.m. OK PyPy 3 TESTS 10 343 20070400
339590937 siddheart2209 B Sept. 20, 2025, 4:56 p.m. OK PyPy 3 TESTS 10 484 21401600
339644420 stavyah B Sept. 21, 2025, 3:20 a.m. OK PyPy 3 TESTS 10 530 10752000
339639237 banibrata2007 B Sept. 21, 2025, 1:28 a.m. OK PyPy 3-64 TESTS 10 124 14336000
339644680 cko B Sept. 21, 2025, 3:24 a.m. OK PyPy 3-64 TESTS 10 124 31641600
339601323 ChanduCforce B Sept. 20, 2025, 5:27 p.m. OK PyPy 3-64 TESTS 10 140 29696000
339617907 learnerdaily5 B Sept. 20, 2025, 7:27 p.m. OK PyPy 3-64 TESTS 10 155 14028800
339591270 ChatGpt_LLM B Sept. 20, 2025, 4:57 p.m. OK PyPy 3-64 TESTS 10 155 20684800
339645797 quocanh190820101 B Sept. 21, 2025, 3:45 a.m. OK PyPy 3-64 TESTS 10 156 8499200
339624034 akash_tah B Sept. 20, 2025, 8:19 p.m. OK PyPy 3-64 TESTS 10 156 14131200
339632679 arjun151 B Sept. 20, 2025, 10:02 p.m. OK PyPy 3-64 TESTS 10 156 19558400
339654973 Little_Sheep_Yawn B Sept. 21, 2025, 5:48 a.m. OK PyPy 3-64 TESTS 10 156 20070400
339618753 Luciefer_x B Sept. 20, 2025, 7:34 p.m. OK PyPy 3-64 TESTS 10 156 24576000
339628249 Saugata123 B Sept. 20, 2025, 9:02 p.m. OK Python 3 TESTS 10 139 28876800
339591384 Arminas03 B Sept. 20, 2025, 4:57 p.m. OK Python 3 TESTS 10 155 35942400
339620648 KAMALASHKUMAARC B Sept. 20, 2025, 7:49 p.m. OK Python 3 TESTS 10 187 46387200
339645359 supermon B Sept. 21, 2025, 3:36 a.m. OK Python 3 TESTS 10 218 27852800
339644466 __akash24_13 B Sept. 21, 2025, 3:21 a.m. OK Python 3 TESTS 10 374 20377600
339655567 eh_Sami B Sept. 21, 2025, 5:55 a.m. OK Python 3 TESTS 10 374 21196800
339595125 Umarov_Akbar B Sept. 20, 2025, 5:08 p.m. OK Python 3 TESTS 10 390 20275200
339592329 mudanvit.goyal B Sept. 20, 2025, 5 p.m. OK Python 3 TESTS 10 390 24371200
339592262 code_djc B Sept. 20, 2025, 5 p.m. OK Python 3 TESTS 10 406 23449600
339592951 devparth_7 B Sept. 20, 2025, 5:02 p.m. OK Python 3 TESTS 10 406 51814400

remove filters

Back to search problems