Educational Codeforces Round 183 (Rated for 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
2145 Educational Codeforces Round 183 (Rated for Div. 2) FINISHED False 7200 16644323 Oct. 6, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 6634 ) D Inversion Value of a Permutation PROGRAMMING constructive algorithms dfs and similar dp math

A permutation of length (n) is an array of (n) integers, where each number from (1) to (n) appears exactly once. An inversion in a permutation (p) is a pair of indices ((i, j)) such that (i < j) and (p_i > p_j). For a permutation (p), we define its inversion value as the number of its subsegments that contain at least one inversion. Formally, this is the number of pairs of integers ((l, r)) ((1 \le l < r \le n)) for which there exists a pair of indices ((i, j)) satisfying the following conditions: (l \le i < j \le r) and (p_i > p_j). For example, for the permutation (3, 1, 4, 2), the inversion value is (5). You are given two integers (n) and (k). Your task is to construct a permutation of length (n) with an inversion value equal to exactly (k) . The first line contains one integer (t) ((1 \le t \le 500)) — the number of test cases. Each test case consists of a single line containing two integers (n) and (k) ((2 \le n \le 30); (0 \le k \le \dfrac{n(n-1)}{2})). For each test case, output the answer as follows: if the desired permutation does not exist, output a single integer (0); otherwise, output (n) distinct integers from (1) to (n) — the desired permutation. If there are multiple such permutations, you may output any of them.

Tutorials

Educational Codeforces Round 183 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
342511287 stoicatlas D Oct. 7, 2025, 9:32 p.m. OK C++17 (GCC 7-32) TESTS 22 46 0
342462631 BoruvkaZn D Oct. 7, 2025, 3:14 p.m. OK C++17 (GCC 7-32) TESTS 22 46 0
342348190 rohajrohit D Oct. 6, 2025, 6:50 p.m. OK C++17 (GCC 7-32) TESTS 22 46 0
342522208 liyinqi D Oct. 8, 2025, 2:02 a.m. OK C++17 (GCC 7-32) TESTS 22 46 102400
342515870 lucas3h D Oct. 7, 2025, 11:40 p.m. OK C++17 (GCC 7-32) TESTS 22 46 102400
342475612 ClosetNarcissist D Oct. 7, 2025, 4:29 p.m. OK C++17 (GCC 7-32) TESTS 22 46 102400
342425901 i_am_wa D Oct. 7, 2025, 11:06 a.m. OK C++17 (GCC 7-32) TESTS 22 46 102400
342463436 nmhai D Oct. 7, 2025, 3:19 p.m. OK C++17 (GCC 7-32) TESTS 22 46 204800
342478929 DecodeX D Oct. 7, 2025, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 22 46 307200
342518806 NiePamietamNicku D Oct. 8, 2025, 12:55 a.m. OK C++17 (GCC 7-32) TESTS 22 61 0
342499421 xurde24 D Oct. 7, 2025, 7:08 p.m. OK C++20 (GCC 13-64) TESTS 22 46 0
342418692 nikT D Oct. 7, 2025, 10:09 a.m. OK C++20 (GCC 13-64) TESTS 22 46 0
342380665 Pro424242 D Oct. 7, 2025, 4 a.m. OK C++20 (GCC 13-64) TESTS 22 46 0
342370430 tarche D Oct. 7, 2025, 1:15 a.m. OK C++20 (GCC 13-64) TESTS 22 46 0
342369827 halley2024 D Oct. 7, 2025, 1:03 a.m. OK C++20 (GCC 13-64) TESTS 22 46 0
342537838 ipisscoffee D Oct. 8, 2025, 5:40 a.m. OK C++20 (GCC 13-64) TESTS 22 46 102400
342526218 .Doctor...Strange. D Oct. 8, 2025, 3:10 a.m. OK C++20 (GCC 13-64) TESTS 22 46 102400
342496558 silentsword255 D Oct. 7, 2025, 6:45 p.m. OK C++20 (GCC 13-64) TESTS 22 46 102400
342434431 icebear_meow D Oct. 7, 2025, 12:10 p.m. OK C++20 (GCC 13-64) TESTS 22 46 102400
342430446 Kalikari D Oct. 7, 2025, 11:40 a.m. OK C++20 (GCC 13-64) TESTS 22 46 102400
342524499 Jkel D Oct. 8, 2025, 2:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342509929 harshhcodess D Oct. 7, 2025, 9:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342480308 chaitanyan D Oct. 7, 2025, 4:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342475571 Ibrahimfostok D Oct. 7, 2025, 4:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342458408 xor-27 D Oct. 7, 2025, 2:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342414904 KathirSrivathsan.S D Oct. 7, 2025, 9:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342409128 gauravbro17 D Oct. 7, 2025, 8:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342379249 Arsud D Oct. 7, 2025, 3:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 0
342538424 sususu04 D Oct. 8, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 102400
342535481 yvbf D Oct. 8, 2025, 5:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 46 102400
342401421 owi8270 D Oct. 7, 2025, 7:47 a.m. OK Go TESTS 22 249 4710400
342352028 WrongAnswerOnTestCase2 D Oct. 6, 2025, 7:24 p.m. OK Java 21 TESTS 22 296 819200
342368436 mlinear D Oct. 7, 2025, 12:32 a.m. OK Java 21 TESTS 22 328 1228800
342381287 ironman263 D Oct. 7, 2025, 4:09 a.m. OK Java 21 TESTS 22 342 1638400
342415960 Swarnadip_Kar D Oct. 7, 2025, 9:47 a.m. OK Java 21 TESTS 22 343 1024000
342422888 vineetiwari D Oct. 7, 2025, 10:43 a.m. OK Java 21 TESTS 22 374 1740800
342474372 akshatjai258 D Oct. 7, 2025, 4:22 p.m. OK Java 21 TESTS 22 452 6758400
342461211 Fenil412 D Oct. 7, 2025, 3:07 p.m. OK Java 21 TESTS 22 468 1331200
342430222 ykaan D Oct. 7, 2025, 11:38 a.m. OK Java 21 TESTS 22 546 1228800
342376057 godAngryOver D Oct. 7, 2025, 2:54 a.m. OK Java 21 TESTS 22 952 1024000
342383839 NpHardcore_05 D Oct. 7, 2025, 4:44 a.m. OK Java 21 TESTS 22 1077 2252800
342434146 Vinayak1031 D Oct. 7, 2025, 12:07 p.m. OK Java 8 TESTS 22 171 0
342470753 testtest111ksjfrdvn D Oct. 7, 2025, 4:01 p.m. OK Java 8 TESTS 22 264 0
342470150 testtest111ksjfrdvn D Oct. 7, 2025, 3:58 p.m. OK Java 8 TESTS 22 265 0
342348745 tirthgohil1410 D Oct. 6, 2025, 6:54 p.m. OK Java 8 TESTS 22 296 143155200
342470335 testtest111ksjfrdvn D Oct. 7, 2025, 3:59 p.m. OK Java 8 TESTS 22 312 0
342410693 Rohan__das D Oct. 7, 2025, 9:04 a.m. OK Java 8 TESTS 22 718 0
342410759 Rohan__das D Oct. 7, 2025, 9:05 a.m. OK Java 8 TESTS 22 765 0
342355428 _Zuno_ D Oct. 6, 2025, 8:01 p.m. OK Node.js TESTS 22 405 9113600
342478229 Emikooh D Oct. 7, 2025, 4:45 p.m. OK PyPy 3-64 TESTS 22 124 3891200
342348764 sushmanth.dampur8780 D Oct. 6, 2025, 6:55 p.m. OK PyPy 3-64 TESTS 22 140 4505600
342408184 IcyGirl D Oct. 7, 2025, 8:43 a.m. OK PyPy 3-64 TESTS 22 156 5734400
342359572 kazumaa16 D Oct. 6, 2025, 8:54 p.m. OK PyPy 3-64 TESTS 22 171 3686400
342405630 wyzl D Oct. 7, 2025, 8:23 a.m. OK PyPy 3-64 TESTS 22 171 7680000
342383753 kamio-misuzu D Oct. 7, 2025, 4:43 a.m. OK PyPy 3-64 TESTS 22 171 8704000
342514301 parthtotalfun D Oct. 7, 2025, 10:50 p.m. OK PyPy 3-64 TESTS 22 171 10137600
342416326 SHIVANG12 D Oct. 7, 2025, 9:50 a.m. OK PyPy 3-64 TESTS 22 202 4608000
342350728 explainer D Oct. 6, 2025, 7:12 p.m. OK PyPy 3-64 TESTS 22 202 13107200
342466594 _Aditya_Jain_ D Oct. 7, 2025, 3:37 p.m. OK PyPy 3-64 TESTS 22 218 5017600
342521916 jai_gurudev D Oct. 8, 2025, 1:57 a.m. OK Python 3 TESTS 22 93 307200
342410469 IustinFrateanu D Oct. 7, 2025, 9:02 a.m. OK Python 3 TESTS 22 531 204800
342405386 aaditya.samadhiya11 D Oct. 7, 2025, 8:22 a.m. OK Python 3 TESTS 22 1968 1228800

remove filters

Back to search problems