Codeforces Round 957 (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
1992 Codeforces Round 957 (Div. 3) FINISHED False 8100 11114699 July 11, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 29070 ) C Gorilla and Permutation PROGRAMMING constructive algorithms math

B'Gorilla and Noobish_Monk found three numbers n , m , and k ( m < k ). They decided to construct a permutation ^{ dagger} of length n . For the permutation, Noobish_Monk came up with the following function: g(i) is the sum of all the numbers in the permutation on a prefix of length i that are not greater than m . Similarly, Gorilla came up with the function f , where f(i) is the sum of all the numbers in the permutation on a prefix of length i that are not less than k . A prefix of length i is a subarray consisting of the first i elements of the original array. For example, if n = 5 , m = 2 , k = 5 , and the permutation is [5, 3, 4, 1, 2] , then: Help them find a permutation for which the value of <= ft( sum_{i=1}^n f(i) - sum_{i=1}^n g(i) right) is maximized. ^{ dagger} A permutation of length n is an array consisting of n distinct integers from 1 to n in any order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (as 2 appears twice in the array) and [1,3,4] is also not a permutation (as n=3 , but 4 appears in the array). The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The only line of each case contains three integers n , m , k ( 2 <= n <= 10^5 ; 1 <= m < k <= n ) -- the size of the permutation to be constructed and two integers. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output the permutation -- a set of numbers that satisfies the conditions of the problem. If there are multiple solutions, output any of them. In the first example, <= ft( sum_{i=1}^n f(i) - sum_{i=1}^n g(i) right) = 5 cdot 5 - (0 cdot 3 + 1 + 3) = 25 - 4 = 21 '...

Tutorials

Shayan's Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
270077071 kokora C July 11, 2024, 7:27 p.m. OK C# 10 TESTS 7 108 16281600
270116978 Annliase C July 12, 2024, 4:57 a.m. OK C++14 (GCC 6-32) TESTS 7 61 0
270107872 OurStory C July 12, 2024, 3:14 a.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270105043 rank22 C July 12, 2024, 2:45 a.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270089402 Donia99 C July 11, 2024, 10:19 p.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270088569 b.tugsuu1020 C July 11, 2024, 10:01 p.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270081359 Munwind C July 11, 2024, 8:14 p.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270079629 slime100 C July 11, 2024, 7:54 p.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270078367 O_oAHHA C July 11, 2024, 7:40 p.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270110792 donbasta C July 12, 2024, 3:44 a.m. OK C++14 (GCC 6-32) TESTS 7 62 0
270103096 xiaoxuetongxue C July 12, 2024, 2:21 a.m. OK C++14 (GCC 6-32) TESTS 7 62 1638400
270094384 bharatwaj.csn C July 12, 2024, 12:08 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0
270106899 M7A7 C July 12, 2024, 3:04 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0
270077492 alaaalwany0 C July 11, 2024, 7:31 p.m. OK C++17 (GCC 7-32) TESTS 7 46 0
270068042 vedant-z C July 11, 2024, 6:08 p.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270117117 jokkeer C July 12, 2024, 4:59 a.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270114961 Shuvo_06 C July 12, 2024, 4:35 a.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270107495 abhinavvv306 C July 12, 2024, 3:10 a.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270098557 EnsureGoldd C July 12, 2024, 1:19 a.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270082155 arjoy605 C July 11, 2024, 8:23 p.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270067801 Badhon_1 C July 11, 2024, 6:06 p.m. OK C++17 (GCC 7-32) TESTS 7 61 0
270113631 vduczz C July 12, 2024, 4:18 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270122171 Anirban2046 C July 12, 2024, 5:48 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270121379 Drt7405 C July 12, 2024, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270115990 sadat_islam C July 12, 2024, 4:46 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270115956 abdull_mama C July 12, 2024, 4:46 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270115706 HappyCodingLife. C July 12, 2024, 4:43 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270110997 Ym527 C July 12, 2024, 3:46 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270110109 Entropy. C July 12, 2024, 3:37 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270109150 RandomniRandom C July 12, 2024, 3:27 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270108840 lzh99594 C July 12, 2024, 3:24 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0
270091743 bluemegane C July 11, 2024, 11:09 p.m. OK C# 8 TESTS 7 124 10854400
270113891 Brackets12 C July 12, 2024, 4:21 a.m. OK FPC TESTS 7 249 0
270083856 2205103 C July 11, 2024, 8:46 p.m. OK GNU C11 TESTS 7 780 102400
270103405 cacker C July 12, 2024, 2:25 a.m. OK GNU C11 TESTS 7 781 102400
270106230 fa2_l C July 12, 2024, 2:57 a.m. OK GNU C11 TESTS 7 796 512000
270087287 swastikdas1504 C July 11, 2024, 9:38 p.m. OK GNU C11 TESTS 7 811 1126400
270106545 fa2_l C July 12, 2024, 3:01 a.m. OK GNU C11 TESTS 7 827 102400
270090161 lyongwolf C July 11, 2024, 10:34 p.m. OK Java 21 TESTS 7 233 512000
270122405 amit_roy C July 12, 2024, 5:50 a.m. OK Java 21 TESTS 7 249 0
270119227 InfinityX C July 12, 2024, 5:20 a.m. OK Java 21 TESTS 7 250 512000
270084897 arwa_khattab C July 11, 2024, 9:01 p.m. OK Java 21 TESTS 7 280 512000
270085065 M_Hassanin488 C July 11, 2024, 9:03 p.m. OK Java 21 TESTS 7 281 512000
270074643 ankush9140 C July 11, 2024, 7:04 p.m. OK Java 21 TESTS 7 296 614400
270054477 The_Reaper001 C July 11, 2024, 5:36 p.m. OK Java 21 TESTS 7 328 819200
270052446 vishal_sahu C July 11, 2024, 5:23 p.m. OK Java 21 TESTS 7 359 614400
270091307 popt C July 11, 2024, 10:58 p.m. OK Java 21 TESTS 7 374 921600
270095886 goalboy C July 12, 2024, 12:36 a.m. OK Java 21 TESTS 7 389 6860800
270084867 Blue_BEE C July 11, 2024, 9 p.m. OK Java 8 TESTS 7 171 0
270076193 maheshwarang001 C July 11, 2024, 7:18 p.m. OK Java 8 TESTS 7 187 0
270068009 Safawt C July 11, 2024, 6:08 p.m. OK Java 8 TESTS 7 187 0
270080184 Sumitsingh7 C July 11, 2024, 8 p.m. OK Java 8 TESTS 7 421 8192000
270119493 coderman2004 C July 12, 2024, 5:23 a.m. OK Java 8 TESTS 7 437 0
270118747 Kempachi C July 12, 2024, 5:15 a.m. OK Java 8 TESTS 7 437 0
270052725 parasvinay92121 C July 11, 2024, 5:25 p.m. OK Java 8 TESTS 7 452 0
270118798 priyanshu870 C July 12, 2024, 5:16 a.m. OK Java 8 TESTS 7 468 0
270115973 Rianj C July 12, 2024, 4:46 a.m. OK Java 8 TESTS 7 483 0
270107338 domesandms C July 12, 2024, 3:09 a.m. OK Java 8 TESTS 7 499 0
270111025 51Hz C July 12, 2024, 3:46 a.m. OK Kotlin 1.9 TESTS 7 280 0
270090363 random__person C July 11, 2024, 10:37 p.m. OK PyPy 3 TESTS 7 156 12800000
270102219 Sparkle_Twilight C July 12, 2024, 2:10 a.m. OK PyPy 3 TESTS 7 202 12595200
270102196 ZzaZi C July 12, 2024, 2:10 a.m. OK PyPy 3 TESTS 7 202 12595200
270088441 papdichaat C July 11, 2024, 9:59 p.m. OK PyPy 3 TESTS 7 343 10240000
270095959 TheBestFromEast C July 12, 2024, 12:37 a.m. OK PyPy 3 TESTS 7 374 13721600
270113150 Ishaan_06 C July 12, 2024, 4:11 a.m. OK PyPy 3 TESTS 7 375 9932800
270082334 1234567890123 C July 11, 2024, 8:26 p.m. OK PyPy 3 TESTS 7 390 9830400
270121547 iwa2no C July 12, 2024, 5:42 a.m. OK PyPy 3 TESTS 7 406 9728000
270086625 randombernie C July 11, 2024, 9:27 p.m. OK PyPy 3-64 TESTS 7 109 10547200
270070379 gardengnome C July 11, 2024, 6:27 p.m. OK PyPy 3-64 TESTS 7 124 7680000
270077771 DeathbringerY C July 11, 2024, 7:34 p.m. OK PyPy 3-64 TESTS 7 124 8806400
270093593 Synaptic_Savant C July 11, 2024, 11:53 p.m. OK PyPy 3-64 TESTS 7 124 9932800
270070144 Fire_Force C July 11, 2024, 6:25 p.m. OK PyPy 3-64 TESTS 7 124 11366400
270073072 Bishwanath C July 11, 2024, 6:49 p.m. OK PyPy 3-64 TESTS 7 125 8704000
270077911 DeathbringerY C July 11, 2024, 7:35 p.m. OK PyPy 3-64 TESTS 7 125 9216000
270111580 swayam3108 C July 12, 2024, 3:53 a.m. OK PyPy 3-64 TESTS 7 140 9830400
270106064 ntarsis30 C July 12, 2024, 2:56 a.m. OK PyPy 3-64 TESTS 7 140 11571200
270118405 master_JD C July 12, 2024, 5:12 a.m. OK PyPy 3-64 TESTS 7 140 11878400
270094861 lwp666 C July 12, 2024, 12:17 a.m. OK Python 3 TESTS 7 155 15564800
270053185 nandhagk1729 C July 11, 2024, 5:28 p.m. OK Python 3 TESTS 7 156 11980800
270123713 prathipati C July 12, 2024, 6:01 a.m. OK Python 3 TESTS 7 265 4812800
270083297 eugalt C July 11, 2024, 8:38 p.m. OK Python 3 TESTS 7 265 4915200
270079841 BeastRD C July 11, 2024, 7:57 p.m. OK Python 3 TESTS 7 265 8396800
270105620 sy_NBA C July 12, 2024, 2:51 a.m. OK Python 3 TESTS 7 281 0
270113933 Mukul_Kholiya C July 12, 2024, 4:22 a.m. OK Python 3 TESTS 7 281 5939200
270100615 pranay_k C July 12, 2024, 1:48 a.m. OK Python 3 TESTS 7 281 8294400
270054135 K-Marjona C July 11, 2024, 5:34 p.m. OK Python 3 TESTS 7 296 0
270067752 wjlx334 C July 11, 2024, 6:06 p.m. OK Python 3 TESTS 7 296 4608000
270051560 victorborzov C July 11, 2024, 5:18 p.m. OK Rust 2021 TESTS 7 92 2457600
270054903 victorborzov C July 11, 2024, 5:39 p.m. OK Rust 2021 TESTS 7 109 1638400

remove filters

Back to search problems