Spectral::Cup 2026 Round 1 (Codeforces Round 1094, 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
2222 Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) FINISHED False 9000 1437864 April 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3283 ) D Permutation Construction PROGRAMMING constructive algorithms sortings

You are given an array (a) consisting of (n) integers. For an inversion(^{\text{∗}}) ((i,j)) in a permutation(^{\text{†}}) (p), its value is defined as (\sum\limits_{k=i}^{j-1} a_k). The beauty of a permutation is the sum of the values over all its inversions. You have to construct a permutation (p) of length (n) that maximizes its beauty . (^{\text{∗}})An inversion in the permutation (p) of length (n) is a pair of indices ((i,j)) such that (1\leq i \lt j\leq n) and (p_i \gt p_j). For example, when (p=1,4,2,3,5), the pair ((2,3)) is an inversion, but ((1,2)) is not an inversion ((p_1=1) is not greater than (p_2=4)), and ((4,2)) is also not an inversion (the index (4) is not less than (2)). When (p=1), there are no inversions at all. (^{\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). 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 first line of each test case contains a single integer (n) ((1\le n \le 2\cdot 10^5)) — the length of (a). The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((-10^9\leq a_i\leq 10^9)) — the elements of (a). 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 (n) integers — the permutation (p) that maximizes its beauty . If there are multiple valid answers, you may print any of them. In the first test case, the permutation (p) can only be (1). In the second test cas

Tutorials

Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
372509626 sasafied D April 25, 2026, 4 p.m. OK C# 10 TESTS 30 156 8089600
372525937 abhishekr1 D April 25, 2026, 5:01 p.m. OK C++17 (GCC 7-32) TESTS 30 109 102400
372570673 Pixel_fish D April 26, 2026, 5:24 a.m. OK C++17 (GCC 7-32) TESTS 30 109 1024000
372566941 devecent D April 26, 2026, 4:16 a.m. OK C++17 (GCC 7-32) TESTS 30 109 1024000
372519401 malachi_toney_goat D April 25, 2026, 4:35 p.m. OK C++17 (GCC 7-32) TESTS 30 109 1740800
372514116 ukai3444 D April 25, 2026, 4:16 p.m. OK C++17 (GCC 7-32) TESTS 30 109 1740800
372516359 ddd_0415 D April 25, 2026, 4:24 p.m. OK C++17 (GCC 7-32) TESTS 30 109 3379200
372513519 AJNJ D April 25, 2026, 4:14 p.m. OK C++17 (GCC 7-32) TESTS 30 109 3379200
372544478 phoenix0112 D April 25, 2026, 8:37 p.m. OK C++17 (GCC 7-32) TESTS 30 109 4812800
372555606 xuan2024 D April 26, 2026, 1:19 a.m. OK C++17 (GCC 7-32) TESTS 30 109 6451200
372551290 Triscoma D April 25, 2026, 11:03 p.m. OK C++17 (GCC 7-32) TESTS 30 125 102400
372543723 Geothermal D April 25, 2026, 8:26 p.m. OK C++20 (GCC 13-64) TESTS 30 46 1126400
372508540 fdasgreag D April 25, 2026, 3:57 p.m. OK C++20 (GCC 13-64) TESTS 30 62 3584000
372545485 _MANS0UR_ D April 25, 2026, 8:52 p.m. OK C++20 (GCC 13-64) TESTS 30 78 921600
372553590 kamyak D April 26, 2026, 12:24 a.m. OK C++20 (GCC 13-64) TESTS 30 78 2457600
372516579 oskarkk D April 25, 2026, 4:25 p.m. OK C++20 (GCC 13-64) TESTS 30 78 2764800
372563358 CStr. D April 26, 2026, 3 a.m. OK C++20 (GCC 13-64) TESTS 30 78 3379200
372553398 xiachi D April 26, 2026, 12:17 a.m. OK C++20 (GCC 13-64) TESTS 30 93 0
372547950 Hanoko1314 D April 25, 2026, 9:34 p.m. OK C++20 (GCC 13-64) TESTS 30 93 409600
372547939 Hanoko1314 D April 25, 2026, 9:33 p.m. OK C++20 (GCC 13-64) TESTS 30 93 819200
372561782 suLang D April 26, 2026, 2:16 a.m. OK C++20 (GCC 13-64) TESTS 30 93 921600
372562187 binglengmo D April 26, 2026, 2:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 1228800
372507935 Laoxu0919 D April 25, 2026, 3:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 62 8908800
372554441 Leeeee D April 26, 2026, 12:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 78 1024000
372552019 7etem D April 25, 2026, 11:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 78 1126400
372548424 abdelaal_03 D April 25, 2026, 9:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 78 3379200
372564858 Arpa D April 26, 2026, 3:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 93 0
372553727 Erkhem_G D April 26, 2026, 12:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 93 204800
372545005 fazliddin2001 D April 25, 2026, 8:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 93 204800
372536677 Mischiefius D April 25, 2026, 6:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 93 204800
372527165 chtar D April 25, 2026, 5:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 93 204800
372518228 Gassa D April 25, 2026, 4:31 p.m. OK D TESTS 30 328 27955200
372514771 dhiraj_pgcat D April 25, 2026, 4:18 p.m. OK GNU C11 TESTS 30 1062 5632000
372539716 uchihieu2k7 D April 25, 2026, 7:32 p.m. OK GNU C11 TESTS 30 1078 6553600
372526083 Segmentati0nFault D April 25, 2026, 5:01 p.m. OK GNU C11 TESTS 30 1828 5632000
372516489 kuberql-learn D April 25, 2026, 4:24 p.m. OK GNU C11 TESTS 30 1875 7270400
372512214 adityasinghtomar78 D April 25, 2026, 4:09 p.m. OK Go TESTS 30 187 7168000
372525730 kevin2003 D April 25, 2026, 5 p.m. OK Go TESTS 30 203 9113600
372515678 baogiocoduocem D April 25, 2026, 4:21 p.m. OK Java 21 TESTS 30 296 1740800
372514964 AnkanMisra D April 25, 2026, 4:19 p.m. OK Java 21 TESTS 30 343 5222400
372510132 lybord D April 25, 2026, 4:02 p.m. OK Java 21 TESTS 30 343 9420800
372512659 ankitverma10203 D April 25, 2026, 4:11 p.m. OK Java 21 TESTS 30 375 7987200
372519703 vigneshgopal200 D April 25, 2026, 4:37 p.m. OK Java 21 TESTS 30 375 9932800
372514248 ibrahimjp630 D April 25, 2026, 4:16 p.m. OK Java 21 TESTS 30 390 6860800
372526250 pieande D April 25, 2026, 5:02 p.m. OK Java 21 TESTS 30 390 8908800
372507963 imperial_X D April 25, 2026, 3:55 p.m. OK Java 21 TESTS 30 406 5836800
372511937 kevin_0911 D April 25, 2026, 4:08 p.m. OK Java 21 TESTS 30 406 12492800
372509397 Sniper654 D April 25, 2026, 4 p.m. OK Java 21 TESTS 30 421 7680000
372514769 hardgonnapass D April 25, 2026, 4:18 p.m. OK Java 8 TESTS 30 203 3276800
372520314 maniteja517 D April 25, 2026, 4:39 p.m. OK Java 8 TESTS 30 281 12185600
372513242 0xdaksh.12 D April 25, 2026, 4:13 p.m. OK Java 8 TESTS 30 765 0
372514463 yashbansal99 D April 25, 2026, 4:17 p.m. OK Java 8 TESTS 30 796 10137600
372508097 Ayush79 D April 25, 2026, 3:56 p.m. OK Kotlin 2.2 TESTS 30 203 23859200
372510099 bitplease_ D April 25, 2026, 4:02 p.m. OK Node.js TESTS 30 312 72499200
372519686 sophie_hatter D April 25, 2026, 4:36 p.m. OK PyPy 3 TESTS 30 828 37888000
372521461 mattiasj D April 25, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 30 265 37171200
372561233 jigglemaster7 D April 26, 2026, 1:59 a.m. OK PyPy 3-64 TESTS 30 281 34816000
372518624 Qebew D April 25, 2026, 4:33 p.m. OK PyPy 3-64 TESTS 30 296 37376000
372512046 Doflaming0 D April 25, 2026, 4:09 p.m. OK PyPy 3-64 TESTS 30 296 37785600
372561486 huiliyi666 D April 26, 2026, 2:06 a.m. OK PyPy 3-64 TESTS 30 296 38502400
372508612 saidatta993 D April 25, 2026, 3:57 p.m. OK PyPy 3-64 TESTS 30 312 36249600
372513660 SuperNativ D April 25, 2026, 4:14 p.m. OK PyPy 3-64 TESTS 30 328 34713600
372525687 iota_bhai D April 25, 2026, 5 p.m. OK PyPy 3-64 TESTS 30 328 36761600
372520811 tttgggccc D April 25, 2026, 4:41 p.m. OK PyPy 3-64 TESTS 30 328 36966400
372509686 M.Haikal D April 25, 2026, 4:01 p.m. OK PyPy 3-64 TESTS 30 328 40550400
372565116 code-xx D April 26, 2026, 3:40 a.m. OK Python 3 TESTS 30 265 51302400
372523308 chbhuvan12 D April 25, 2026, 4:51 p.m. OK Python 3 TESTS 30 296 60006400
372522786 Synthexia D April 25, 2026, 4:49 p.m. OK Python 3 TESTS 30 312 66150400
372513548 Russel-Morant-James D April 25, 2026, 4:14 p.m. OK Python 3 TESTS 30 359 61542400
372518953 Saf1re_himself D April 25, 2026, 4:34 p.m. OK Python 3 TESTS 30 359 62464000
372525525 Shadow.Siren D April 25, 2026, 4:59 p.m. OK Python 3 TESTS 30 375 42393600
372508474 siddynexp D April 25, 2026, 3:57 p.m. OK Python 3 TESTS 30 406 63897600
372520109 harsha_jagu D April 25, 2026, 4:38 p.m. OK Python 3 TESTS 30 421 42393600
372518369 Nemesis2004 D April 25, 2026, 4:32 p.m. OK Python 3 TESTS 30 421 42393600
372525110 Eigencoder D April 25, 2026, 4:58 p.m. OK Python 3 TESTS 30 453 64921600
372517620 caffeine2ac D April 25, 2026, 4:29 p.m. OK Ruby 3 TESTS 30 1906 91648000
372519062 kushagrakaneki D April 25, 2026, 4:34 p.m. OK Rust 2024 TESTS 30 62 16179200
372519768 SaucyFries69 D April 25, 2026, 4:37 p.m. OK Rust 2024 TESTS 30 78 15667200
372518254 neulfox D April 25, 2026, 4:31 p.m. OK Rust 2024 TESTS 30 78 17305600
372525055 Cyros D April 25, 2026, 4:58 p.m. OK Scala TESTS 30 875 21811200

remove filters

Back to search problems