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 |
---|---|---|---|---|---|---|
1847 | Codeforces Round 882 (Div. 2) | FINISHED | False | 8100 | 43169099 | July 6, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 22063 ) | A | The Man who became a God | PROGRAMMING | greedy sortings |
B'Kars is tired and resentful of the narrow mindset of his village since they are content with staying where they are and are not trying to become the perfect life form. Being a top-notch inventor, Kars wishes to enhance his body and become the perfect life form. Unfortunately, n of the villagers have become suspicious of his ideas. The i -th villager has a suspicion of a_i on him. Individually each villager is scared of Kars, so they form into groups to be more powerful. The power of the group of villagers from l to r be defined as f(l,r) where f(l,r) = |a_l - a_{l+1}| + |a_{l + 1} - a_{l + 2}| + ldots + |a_{r-1} - a_r|. Here |x-y| is the absolute value of x-y . A group with only one villager has a power of 0 . Kars wants to break the villagers into exactly k contiguous subgroups so that the sum of their power is minimized. Formally, he must find k - 1 positive integers 1 <= r_1 < r_2 < ldots < r_{k - 1} < n such that f(1, r_1) + f(r_1 + 1, r_2) + ldots + f(r_{k-1} + 1, n) is minimised. Help Kars in finding the minimum value of f(1, r_1) + f(r_1 + 1, r_2) + ldots + f(r_{k-1} + 1, n) . The first line contains a single integer t (1 <= q t <= q 100) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n,k (1 <= q k <= q n <= q 100) -- the number of villagers and the number of groups they must be split into. The second line of each test case contains n integers a_1,a_2, ldots, a_n (1 <= q a_i <= q 500) -- the suspicion of each of the villagers. For each test case, output a single integer -- the minimum possible value of sum of power of all the groups i. e. the minimum possible value of f(1,r_1) + f(r_1 + 1, r_2) + ldots + f(r_{k-1} + 1, n) . In the first test case, we will group the villagers with suspicion (1,3,5,2) into (1,3,5)$'... |
Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
212478308 | bluemegane | A | July 6, 2023, 10:12 p.m. | OK | C# 8 | TESTS | 11 | 92 | 1126400 | ||
212489272 | China-zyk. | A | July 7, 2023, 1:50 a.m. | OK | Clang++17 Diagnostics | TESTS | 14 | 62 | 3174400 | ||
212460083 | sexyboy6969 | A | July 6, 2023, 6:39 p.m. | OK | Clang++20 Diagnostics | TESTS | 11 | 62 | 0 | ||
212503336 | EternityPure | A | July 7, 2023, 4:51 a.m. | OK | Clang++20 Diagnostics | TESTS | 14 | 62 | 0 | ||
212458563 | HARSHA2004 | A | July 6, 2023, 6:26 p.m. | OK | Clang++20 Diagnostics | TESTS | 11 | 62 | 5324800 | ||
212498764 | problemkillerAC | A | July 7, 2023, 3:48 a.m. | OK | Clang++20 Diagnostics | TESTS | 14 | 77 | 3174400 | ||
212442726 | Najanajah | A | July 6, 2023, 4:33 p.m. | OK | GNU C11 | TESTS | 11 | 15 | 0 | ||
212446124 | sahmanojkumar1976 | A | July 6, 2023, 4:43 p.m. | OK | GNU C11 | TESTS | 11 | 15 | 0 | ||
212460164 | JStark20 | A | July 6, 2023, 6:39 p.m. | OK | GNU C11 | TESTS | 11 | 15 | 0 | ||
212471824 | Kartikeya_sati | A | July 6, 2023, 8:30 p.m. | OK | GNU C11 | TESTS | 11 | 31 | 0 | ||
212501405 | Kefira_Duduco | A | July 7, 2023, 4:24 a.m. | OK | GNU C11 | TESTS | 14 | 31 | 0 | ||
212446235 | kari72901 | A | July 6, 2023, 4:43 p.m. | OK | GNU C11 | TESTS | 11 | 296 | 0 | ||
212508467 | xutianlan | A | July 7, 2023, 5:56 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212507946 | RsCb | A | July 7, 2023, 5:50 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212507407 | ZZL0136 | A | July 7, 2023, 5:45 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212498790 | DevButani | A | July 7, 2023, 3:48 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212498211 | sultan_ul_arfin | A | July 7, 2023, 3:41 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212497904 | skytcl | A | July 7, 2023, 3:38 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212497634 | wswwtx | A | July 7, 2023, 3:34 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212497100 | TEoS | A | July 7, 2023, 3:28 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212495838 | 20100202ww | A | July 7, 2023, 3:13 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212495582 | naibi | A | July 7, 2023, 3:10 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
212461397 | _Scorpion | A | July 6, 2023, 6:51 p.m. | OK | GNU C++17 | TESTS | 11 | 0 | 102400 | ||
212469071 | Polash_Islam | A | July 6, 2023, 7:55 p.m. | OK | GNU C++17 | TESTS | 11 | 0 | 8192000 | ||
212502887 | Katel | A | July 7, 2023, 4:45 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212502078 | appease | A | July 7, 2023, 4:33 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212506521 | tempdata | A | July 7, 2023, 5:34 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212504409 | Enid1107 | A | July 7, 2023, 5:06 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212508370 | Khushi_Baghel | A | July 7, 2023, 5:55 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212508945 | JimJXY | A | July 7, 2023, 6:01 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212507194 | s4ndy | A | July 7, 2023, 5:42 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212503643 | Aaayc. | A | July 7, 2023, 4:55 a.m. | OK | GNU C++17 | TESTS | 14 | 15 | 0 | ||
212471588 | pwnp | A | July 6, 2023, 8:27 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212507609 | KoiRaheNaJabApna | A | July 7, 2023, 5:47 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
212495901 | Sy_03 | A | July 7, 2023, 3:13 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
212471125 | UnfitCoder | A | July 6, 2023, 8:21 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212459023 | mdtuhinhasnat | A | July 6, 2023, 6:30 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212457938 | sahibsingh139 | A | July 6, 2023, 6:22 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212454522 | _Yeager_ | A | July 6, 2023, 6 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212454115 | DNK420 | A | July 6, 2023, 5:58 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212453030 | Kolwdfurr_Rad | A | July 6, 2023, 5:53 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 0 | 0 | ||
212506462 | deepubdps | A | July 7, 2023, 5:33 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 15 | 0 | ||
212505938 | binomanjesh | A | July 7, 2023, 5:27 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212505342 | wrckr | A | July 7, 2023, 5:19 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212505205 | ar_rony1 | A | July 7, 2023, 5:17 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212504686 | Rohit_1009 | A | July 7, 2023, 5:10 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212507104 | aman_14as | A | July 7, 2023, 5:41 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212507676 | Sandeep._10_.Pandit | A | July 7, 2023, 5:48 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212508793 | bhaumilpanchal | A | July 7, 2023, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212508801 | AdarshSantoria | A | July 7, 2023, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212508976 | Gourab_Chatterjee | A | July 7, 2023, 6:01 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212506800 | Avijit_Biswas | A | July 7, 2023, 5:38 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
212493218 | Nanthakumar06 | A | July 7, 2023, 2:42 a.m. | OK | Java 11 | TESTS | 14 | 217 | 0 | ||
212508274 | ujjwal_a0001 | A | July 7, 2023, 5:54 a.m. | OK | Java 11 | TESTS | 14 | 218 | 0 | ||
212492556 | manish26eleven | A | July 7, 2023, 2:34 a.m. | OK | Java 11 | TESTS | 14 | 218 | 0 | ||
212456190 | Asik04 | A | July 6, 2023, 6:10 p.m. | OK | Java 11 | TESTS | 11 | 218 | 0 | ||
212497808 | achal5623 | A | July 7, 2023, 3:37 a.m. | OK | Java 11 | TESTS | 14 | 233 | 0 | ||
212506006 | too_depressed | A | July 7, 2023, 5:27 a.m. | OK | Java 11 | TESTS | 14 | 265 | 0 | ||
212495442 | EricM08 | A | July 7, 2023, 3:08 a.m. | OK | Java 11 | TESTS | 14 | 312 | 0 | ||
212443958 | sn31al_18 | A | July 6, 2023, 4:37 p.m. | OK | Java 11 | TESTS | 11 | 764 | 0 | ||
212474804 | InfinitePath | A | July 6, 2023, 9:11 p.m. | OK | Java 17 | TESTS | 11 | 186 | 41984000 | ||
212473175 | Vrutik_2809 | A | July 6, 2023, 8:47 p.m. | OK | Java 17 | TESTS | 11 | 187 | 307200 | ||
212472943 | romanrich89 | A | July 6, 2023, 8:44 p.m. | OK | Java 17 | TESTS | 11 | 187 | 819200 | ||
212485985 | Abdelrahman.M.3 | A | July 7, 2023, 12:54 a.m. | OK | Java 17 | TESTS | 14 | 202 | 204800 | ||
212461340 | imvivekthakur | A | July 6, 2023, 6:50 p.m. | OK | Java 17 | TESTS | 11 | 202 | 409600 | ||
212455726 | SuprHUlk | A | July 6, 2023, 6:07 p.m. | OK | Java 17 | TESTS | 11 | 202 | 512000 | ||
212506728 | bbishwajit05 | A | July 7, 2023, 5:37 a.m. | OK | Java 17 | TESTS | 14 | 218 | 819200 | ||
212466299 | _ryan18_ | A | July 6, 2023, 7:25 p.m. | OK | Java 17 | TESTS | 11 | 233 | 512000 | ||
212500426 | rajashish914 | A | July 7, 2023, 4:10 a.m. | OK | Java 17 | TESTS | 14 | 233 | 921600 | ||
212499016 | yelamanq | A | July 7, 2023, 3:52 a.m. | OK | Java 17 | TESTS | 14 | 233 | 921600 | ||
212445875 | sau_arv_gul | A | July 6, 2023, 4:42 p.m. | OK | Java 8 | TESTS | 11 | 108 | 0 | ||
212493858 | thesuperRL | A | July 7, 2023, 2:51 a.m. | OK | Java 8 | TESTS | 14 | 109 | 0 | ||
212494885 | Sumitsingh7 | A | July 7, 2023, 3:02 a.m. | OK | Java 8 | TESTS | 14 | 109 | 5939200 | ||
212496135 | dhruvil8804 | A | July 7, 2023, 3:16 a.m. | OK | Java 8 | TESTS | 14 | 124 | 0 | ||
212443193 | Shaker_32 | A | July 6, 2023, 4:34 p.m. | OK | Java 8 | TESTS | 11 | 124 | 0 | ||
212454705 | raj_shahh | A | July 6, 2023, 6:01 p.m. | OK | Java 8 | TESTS | 11 | 124 | 38195200 | ||
212505281 | Rameez_Wahid | A | July 7, 2023, 5:18 a.m. | OK | Java 8 | TESTS | 14 | 140 | 0 | ||
212502128 | aysham | A | July 7, 2023, 4:34 a.m. | OK | Java 8 | TESTS | 14 | 140 | 0 | ||
212491379 | JavaGodPeter | A | July 7, 2023, 2:20 a.m. | OK | Java 8 | TESTS | 14 | 140 | 0 | ||
212488371 | 2215163301 | A | July 7, 2023, 1:35 a.m. | OK | Java 8 | TESTS | 14 | 140 | 0 | ||
212487979 | CF22190218 | A | July 7, 2023, 1:28 a.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 0 | ||
212446851 | Weeb | A | July 6, 2023, 4:45 p.m. | OK | MS C++ 2017 | TESTS | 11 | 30 | 0 | ||
212503776 | WeCun | A | July 7, 2023, 4:57 a.m. | OK | MS C++ 2017 | TESTS | 14 | 31 | 0 | ||
212501039 | Ravitosh | A | July 7, 2023, 4:19 a.m. | OK | MS C++ 2017 | TESTS | 14 | 31 | 0 | ||
212486840 | 0.o___o.0 | A | July 7, 2023, 1:10 a.m. | OK | MS C++ 2017 | TESTS | 14 | 31 | 0 | ||
212465503 | ch21btech11036 | A | July 6, 2023, 7:16 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 0 | ||
212444280 | kate.shs.2001 | A | July 6, 2023, 4:37 p.m. | OK | PyPy 3 | TESTS | 11 | 93 | 1433600 | ||
212455333 | Ankush_tonde | A | July 6, 2023, 6:04 p.m. | OK | PyPy 3 | TESTS | 11 | 108 | 2150400 | ||
212503853 | jvatsal0709 | A | July 7, 2023, 4:58 a.m. | OK | PyPy 3 | TESTS | 14 | 109 | 1638400 | ||
212479173 | Mohamed_Nasr24 | A | July 6, 2023, 10:27 p.m. | OK | PyPy 3 | TESTS | 11 | 109 | 1843200 | ||
212503080 | tumhari_mummy | A | July 7, 2023, 4:48 a.m. | OK | PyPy 3 | TESTS | 14 | 124 | 1638400 | ||
212476031 | l0stempl3 | A | July 6, 2023, 9:30 p.m. | OK | PyPy 3-64 | TESTS | 11 | 61 | 1843200 | ||
212508366 | Hyunsung | A | July 7, 2023, 5:55 a.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 1843200 | ||
212469859 | pgrusha | A | July 6, 2023, 8:04 p.m. | OK | PyPy 3-64 | TESTS | 11 | 62 | 1843200 | ||
212476705 | MdAbedin | A | July 6, 2023, 9:43 p.m. | OK | PyPy 3-64 | TESTS | 11 | 62 | 1945600 | ||
212459806 | date3k2 | A | July 6, 2023, 6:36 p.m. | OK | PyPy 3-64 | TESTS | 11 | 62 | 1945600 | ||
212491991 | Antonio_Colapso_07 | A | July 7, 2023, 2:28 a.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 2150400 | ||
212502038 | Mustela_Erminea | A | July 7, 2023, 4:33 a.m. | OK | PyPy 3-64 | TESTS | 14 | 62 | 2252800 | ||
212468662 | Sizanov_Igor | A | July 6, 2023, 7:50 p.m. | OK | PyPy 3-64 | TESTS | 11 | 62 | 2252800 | ||
212455067 | tushar_kanti | A | July 6, 2023, 6:03 p.m. | OK | PyPy 3-64 | TESTS | 11 | 62 | 2252800 | ||
212455623 | MistaFlash | A | July 6, 2023, 6:06 p.m. | OK | PyPy 3-64 | TESTS | 11 | 77 | 1740800 | ||
212475560 | MShah2003 | A | July 6, 2023, 9:22 p.m. | OK | Python 3 | TESTS | 11 | 31 | 0 | ||
212470049 | moon_01 | A | July 6, 2023, 8:07 p.m. | OK | Python 3 | TESTS | 11 | 31 | 0 | ||
212457248 | mateusvrs | A | July 6, 2023, 6:17 p.m. | OK | Python 3 | TESTS | 11 | 31 | 0 | ||
212484252 | chaitanya1023 | A | July 7, 2023, 12:16 a.m. | OK | Python 3 | TESTS | 14 | 31 | 102400 | ||
212502380 | Kaori_cp | A | July 7, 2023, 4:37 a.m. | OK | Python 3 | TESTS | 14 | 31 | 204800 | ||
212477342 | faintedremix | A | July 6, 2023, 9:54 p.m. | OK | Python 3 | TESTS | 11 | 46 | 0 | ||
212458956 | julian.fortin | A | July 6, 2023, 6:29 p.m. | OK | Python 3 | TESTS | 11 | 46 | 0 | ||
212452739 | ireneacoder | A | July 6, 2023, 5:52 p.m. | OK | Python 3 | TESTS | 11 | 46 | 0 | ||
212446505 | jeetchovatia | A | July 6, 2023, 4:44 p.m. | OK | Python 3 | TESTS | 11 | 46 | 0 | ||
212443153 | yash_vardhan_759 | A | July 6, 2023, 4:34 p.m. | OK | Python 3 | TESTS | 11 | 46 | 0 | ||
212457035 | 0x81 | A | July 6, 2023, 6:15 p.m. | OK | Ruby 3 | TESTS | 11 | 264 | 307200 | ||
212474577 | cptahahab | A | July 6, 2023, 9:07 p.m. | OK | Rust 2021 | TESTS | 11 | 30 | 0 | ||
212484393 | torio | A | July 7, 2023, 12:19 a.m. | OK | Rust 2021 | TESTS | 14 | 30 | 102400 |
Back to search problems