Educational Codeforces Round 165 (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
1969 Educational Codeforces Round 165 (Rated for Div. 2) FINISHED False 7200 22778663 April 29, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9196 ) C Minimizing the Sum PROGRAMMING dp implementation 1700

B"You are given an integer array a of length n . You can perform the following operation: choose an element of the array and replace it with any of its neighbor's value. For example, if a=[3, 1, 2] , you can get one of the arrays [3, 3, 2] , [3, 2, 2] and [1, 1, 2] using one operation, but not [2, 1, 2 ] or [3, 4, 2] . Your task is to calculate the minimum possible total sum of the array if you can perform the aforementioned operation at most k times. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 1 <= n <= 3 cdot 10^5 ; 0 <= k <= 10 ). The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ). Additional constraint on the input: the sum of n over all test cases doesn't exceed 3 cdot 10^5 . For each test case, print a single integer -- the minimum possible total sum of the array if you can perform the aforementioned operation at most k times. In the first example, one of the possible sequences of operations is the following: [3, 1, 2] rightarrow [1, 1, 2 ]. In the second example, you do not need to apply the operation. In the third example, one of the possible sequences of operations is the following: [2, 2, 1, 3] rightarrow [2, 1, 1, 3] rightarrow [2, 1, 1, 1] . In the fourth example, one of the possible sequences of operations is the following: [4, 1, 2, 2, 4, 3] rightarrow [1, 1, 2, 2, 4, 3] rightarrow [1, 1, 1, 2, 4, 3] rightarrow [1, 1, 1, 2, 2, 3] . "...

Tutorials

Educational Codeforces Round 165 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
260111651 nxynb C May 9, 2024, 11:23 a.m. OK C++14 (GCC 6-32) TESTS 11 171 28876800 1700
262450835 All2be9s C May 25, 2024, 2:59 a.m. OK C++14 (GCC 6-32) TESTS 11 187 43622400 1700
260620079 Maximus11 C May 12, 2024, 6:41 a.m. OK C++14 (GCC 6-32) TESTS 11 218 25190400 1700
260871918 3449 C May 14, 2024, 3:22 a.m. OK C++14 (GCC 6-32) TESTS 11 233 28876800 1700
263535167 hhhzzff C May 31, 2024, 5:47 p.m. OK C++14 (GCC 6-32) TESTS 11 233 30105600 1700
259997853 frost_ C May 8, 2024, 12:27 p.m. OK C++14 (GCC 6-32) TESTS 11 249 26419200 1700
261003468 Ebola_Emperor C May 15, 2024, 4:54 a.m. OK C++14 (GCC 6-32) TESTS 11 249 27648000 1700
263535431 luogu_bot5 C May 31, 2024, 5:50 p.m. OK C++14 (GCC 6-32) TESTS 11 249 30105600 1700
261948033 luogu_bot4 C May 21, 2024, 1:24 a.m. OK C++14 (GCC 6-32) TESTS 11 249 30412800 1700
263691983 CF_xyy C June 2, 2024, 2:22 a.m. OK C++14 (GCC 6-32) TESTS 11 249 38502400 1700
261146215 maverick_2003 C May 16, 2024, 5:47 a.m. OK C++17 (GCC 7-32) TESTS 11 171 37273600 1700
261268478 mukanjy0 C May 17, 2024, 3:01 a.m. OK C++17 (GCC 7-32) TESTS 11 186 25190400 1700
260246588 Aberuz C May 10, 2024, 11:57 a.m. OK C++17 (GCC 7-32) TESTS 11 187 30105600 1700
259922601 ermilov.maxim C May 7, 2024, 7:49 p.m. OK C++17 (GCC 7-32) TESTS 11 202 26419200 1700
262665790 RemberMe C May 26, 2024, 7:25 a.m. OK C++17 (GCC 7-32) TESTS 11 202 37273600 1700
260998832 Keith.6 C May 15, 2024, 3:51 a.m. OK C++17 (GCC 7-32) TESTS 11 203 27648000 1700
262041853 liuenci C May 21, 2024, 3:31 p.m. OK C++17 (GCC 7-32) TESTS 11 217 49356800 1700
261656638 Rittin_Sehgal C May 19, 2024, 1:18 p.m. OK C++17 (GCC 7-32) TESTS 11 218 25088000 1700
261043058 khadija10 C May 15, 2024, 11:12 a.m. OK C++17 (GCC 7-32) TESTS 11 218 28876800 1700
260001021 duyoke C May 8, 2024, 12:51 p.m. OK C++17 (GCC 7-32) TESTS 11 218 37273600 1700
260723345 gaga999 C May 13, 2024, 1:13 a.m. OK C++20 (GCC 13-64) TESTS 11 93 27750400 1700
260139042 riariti C May 9, 2024, 2:47 p.m. OK C++20 (GCC 13-64) TESTS 11 108 44953600 1700
259966327 gycheng C May 8, 2024, 7:51 a.m. OK C++20 (GCC 13-64) TESTS 11 109 38502400 1700
260705353 GuestForAWhile C May 12, 2024, 6:56 p.m. OK C++20 (GCC 13-64) TESTS 11 124 23961600 1700
260989639 HyPraT_ C May 15, 2024, 12:29 a.m. OK C++20 (GCC 13-64) TESTS 11 124 25190400 1700
261976520 Ashish_Jha_ C May 21, 2024, 7:36 a.m. OK C++20 (GCC 13-64) TESTS 11 124 26521600 1700
262433036 ChihoLam C May 24, 2024, 7:51 p.m. OK C++20 (GCC 13-64) TESTS 11 124 27545600 1700
262859948 chiragjain12 C May 27, 2024, 9:50 a.m. OK C++20 (GCC 13-64) TESTS 11 124 27648000 1700
260109017 KnownError_ C May 9, 2024, 11:03 a.m. OK C++20 (GCC 13-64) TESTS 11 124 27648000 1700
260022753 quagiadecode C May 8, 2024, 3:58 p.m. OK C++20 (GCC 13-64) TESTS 11 124 27648000 1700
263205642 ruban C May 30, 2024, 6:35 a.m. OK Delphi TESTS 11 718 76492800 1700
261971992 tkddn5623 C May 21, 2024, 6:47 a.m. OK GNU C11 TESTS 11 202 27750400 1700
262110763 tkddn5623 C May 22, 2024, 8:07 a.m. OK GNU C11 TESTS 11 217 27648000 1700
261745201 tkddn5623 C May 20, 2024, 8:33 a.m. OK GNU C11 TESTS 11 217 27750400 1700
262110623 tkddn5623 C May 22, 2024, 8:06 a.m. OK GNU C11 TESTS 11 218 27648000 1700
261745261 tkddn5623 C May 20, 2024, 8:34 a.m. OK GNU C11 TESTS 11 218 27648000 1700
261969217 tkddn5623 C May 21, 2024, 6:11 a.m. OK GNU C11 TESTS 11 233 27750400 1700
260910614 Boomchillsss C May 14, 2024, 10:31 a.m. OK GNU C11 TESTS 11 234 28876800 1700
262218062 tkddn5623 C May 23, 2024, 6:42 a.m. OK GNU C11 TESTS 11 296 51712000 1700
262114547 tkddn5623 C May 22, 2024, 8:38 a.m. OK GNU C11 TESTS 11 359 56422400 1700
262114032 tkddn5623 C May 22, 2024, 8:34 a.m. OK GNU C11 TESTS 11 374 56627200 1700
262676511 nguyenquocthao00 C May 26, 2024, 8:48 a.m. OK Go TESTS 11 639 171008000 1700
260037431 stolis C May 8, 2024, 6:19 p.m. OK Java 21 TESTS 11 530 42393600 1700
260711964 GoldenShadow C May 12, 2024, 8:26 p.m. OK Java 21 TESTS 11 655 54169600 1700
261042217 ramitg254 C May 15, 2024, 11:04 a.m. OK Java 21 TESTS 11 671 41574400 1700
262868754 _global C May 27, 2024, 11:06 a.m. OK Java 21 TESTS 11 671 50483200 1700
260261237 asdparasite C May 10, 2024, 2:19 p.m. OK Java 21 TESTS 11 687 85708800 1700
260261777 asdparasite C May 10, 2024, 2:23 p.m. OK Java 21 TESTS 11 765 44236800 1700
260205516 2210030072 C May 10, 2024, 5:19 a.m. OK Java 21 TESTS 11 936 42598400 1700
259880784 tinapk C May 7, 2024, 1:20 p.m. OK Java 21 TESTS 11 1030 41881600 1700
263656531 skynet_07 C June 1, 2024, 4:28 p.m. OK Java 21 TESTS 11 1078 105574400 1700
263656302 skynet_07 C June 1, 2024, 4:26 p.m. OK Java 21 TESTS 11 1093 105472000 1700
262256492 Sumitsingh7 C May 23, 2024, 12:25 p.m. OK Java 8 TESTS 11 437 45056000 1700
260086680 guaidaokakaxi C May 9, 2024, 7:39 a.m. OK Java 8 TESTS 11 577 66764800 1700
261313757 y_a_s C May 17, 2024, 10:31 a.m. OK Java 8 TESTS 11 640 102707200 1700
261684316 Safawt C May 19, 2024, 5:18 p.m. OK Java 8 TESTS 11 671 46387200 1700
262221761 Sumitsingh7 C May 23, 2024, 7:29 a.m. OK Java 8 TESTS 11 827 121344000 1700
260885989 Jha_coder1942 C May 14, 2024, 6:36 a.m. OK Java 8 TESTS 11 952 40448000 1700
261742603 yvbf C May 20, 2024, 8:09 a.m. OK Java 8 TESTS 11 1202 41676800 1700
259874944 linxiaotian C May 7, 2024, 12:35 p.m. OK Kotlin 1.9 TESTS 11 671 72089600 1700
259876770 linxiaotian C May 7, 2024, 12:50 p.m. OK Kotlin 1.9 TESTS 11 718 72089600 1700
259922234 JoeDelaney2012 C May 7, 2024, 7:44 p.m. OK PyPy 3-64 TESTS 11 546 58777600 1700
261060627 ossau_guildo C May 15, 2024, 1:26 p.m. OK PyPy 3-64 TESTS 11 561 60928000 1700
260081842 pratyanch_jain C May 9, 2024, 6:52 a.m. OK PyPy 3-64 TESTS 11 593 56524800 1700
261907687 Nikita_Malykh C May 20, 2024, 4:48 p.m. OK PyPy 3-64 TESTS 11 593 57753600 1700
262909294 Th_DominaNt C May 27, 2024, 4:24 p.m. OK PyPy 3-64 TESTS 11 608 57241600 1700
260072212 vaibhav0320 C May 9, 2024, 5:19 a.m. OK PyPy 3-64 TESTS 11 609 57856000 1700
261454734 krism C May 18, 2024, 3:59 a.m. OK PyPy 3-64 TESTS 11 624 57139200 1700
260200447 Noureldin C May 10, 2024, 4:08 a.m. OK PyPy 3-64 TESTS 11 624 64819200 1700
263653532 gche C June 1, 2024, 4:03 p.m. OK PyPy 3-64 TESTS 11 640 57036800 1700
261263312 Catee C May 17, 2024, 1:13 a.m. OK PyPy 3-64 TESTS 11 655 59289600 1700
262309990 ambak C May 23, 2024, 8:20 p.m. OK Rust 2021 TESTS 11 171 42598400 1700
259943705 cck111 C May 8, 2024, 3:26 a.m. OK Rust 2021 TESTS 11 218 36249600 1700

remove filters

Back to search problems