Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round)

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
1654 Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round) FINISHED False 8100 84047099 March 20, 2022, 11:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18694 ) A Maximum Cake Tastiness PROGRAMMING greedy implementation sortings 800

B'There are n pieces of cake on a line. The i -th piece of cake has weight a_i ( 1 <= q i <= q n ). The tastiness of the cake is the maximum total weight of two adjacent pieces of cake (i. e., max(a_1+a_2, , a_2+a_3, , ldots, , a_{n-1} + a_{n}) ). You want to maximize the tastiness of the cake. You are allowed to do the following operation at most once (doing more operations would ruin the cake): The subsegment a[l, r] of the array a is the sequence a_l, a_{l+1}, ... , a_r . If you reverse it, the array will become a_1, a_2, ... , a_{l-2}, a_{l-1}, underline{a_r}, underline{a_{r-1}}, underline{ ... }, underline{a_{l+1}}, underline{a_l}, a_{r+1}, a_{r+2}, ... , a_{n-1}, a_n . For example, if the weights are initially [5, 2, 1, 4, 7, 3] , you can reverse the subsegment a[2, 5] , getting [5, underline{7}, underline{4}, underline{1}, underline{2}, 3] . The tastiness of the cake is now 5 + 7 = 12 (while before the operation the tastiness was 4+7=11 ). Find the maximum tastiness of the cake after doing the operation at most once. The first line contains a single integer t ( 1 <= t <= 50 ) -- the number of test cases. The first line of each test case contains a single integer n ( 2 <= n <= 1000 ) -- the number of pieces of cake. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ) -- a_i is the weight of the i -th piece of cake. For each test case, print a single integer: the maximum tastiness of the cake after doing the operation at most once. In the first test case, after reversing the subsegment a[2, 5] , you get a cake with weights [5, underline{7}, underline{4}, underline{1}, underline{2}, 3] . The tastiness of the cake is now max(5+7, 7+4, 4+1, 1+2, 2+3) = 12 . This is the maximum possible tastiness of the cake one can obtain by performing the operati'...

Tutorials

Editorial of Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
150302700 ethankim8683 A March 20, 2022, 8:21 p.m. OK Clang++17 Diagnostics TESTS 9 249 0 800
150285038 ruban A March 20, 2022, 4:24 p.m. OK Delphi TESTS 9 31 104243200 800
150263111 hasnaenadil A March 20, 2022, 1:13 p.m. OK GNU C11 TESTS 9 31 0 800
150292671 sagorahmedmunna A March 20, 2022, 5:51 p.m. OK GNU C11 TESTS 9 31 0 800
150279823 abdur52 A March 20, 2022, 3:29 p.m. OK GNU C11 TESTS 9 46 0 800
150270860 piyalsana A March 20, 2022, 1:47 p.m. OK GNU C11 TESTS 9 78 0 800
150317753 janardan_sharma A March 21, 2022, 3:35 a.m. OK GNU C++14 TESTS 9 15 0 800
150316976 Oscaryang A March 21, 2022, 3:14 a.m. OK GNU C++14 TESTS 9 15 0 800
150314841 sjhhh321 A March 21, 2022, 2:15 a.m. OK GNU C++14 TESTS 9 15 0 800
150308268 soleil_ A March 20, 2022, 10:36 p.m. OK GNU C++14 TESTS 9 15 0 800
150307034 wrc A March 20, 2022, 10:01 p.m. OK GNU C++14 TESTS 9 15 0 800
150325667 Manish_7392 A March 21, 2022, 5:49 a.m. OK GNU C++14 TESTS 9 15 0 800
150322219 HY.0101000XX A March 21, 2022, 5:13 a.m. OK GNU C++14 TESTS 9 15 0 800
150319458 sultaneele A March 21, 2022, 4:19 a.m. OK GNU C++14 TESTS 9 15 0 800
150318890 Md_yz A March 21, 2022, 4:04 a.m. OK GNU C++14 TESTS 9 15 0 800
150326079 hardik2504 A March 21, 2022, 5:56 a.m. OK GNU C++14 TESTS 9 15 0 800
150325433 Ricoprogrammer A March 21, 2022, 5:45 a.m. OK GNU C++17 TESTS 9 15 0 800
150325253 The__Curse A March 21, 2022, 5:42 a.m. OK GNU C++17 TESTS 9 15 0 800
150323010 rishabh0784 A March 21, 2022, 5:27 a.m. OK GNU C++17 TESTS 9 15 0 800
150322512 shyampraveen789 A March 21, 2022, 5:18 a.m. OK GNU C++17 TESTS 9 15 0 800
150321976 zonky A March 21, 2022, 5:09 a.m. OK GNU C++17 TESTS 9 15 0 800
150321120 Mohamed_Dwedar A March 21, 2022, 4:54 a.m. OK GNU C++17 TESTS 9 15 0 800
150320946 namangpt A March 21, 2022, 4:50 a.m. OK GNU C++17 TESTS 9 15 0 800
150320447 rashig123 A March 21, 2022, 4:41 a.m. OK GNU C++17 TESTS 9 15 0 800
150326435 shuba400 A March 21, 2022, 6:02 a.m. OK GNU C++17 TESTS 9 15 0 800
150325584 kigash A March 21, 2022, 5:48 a.m. OK GNU C++17 TESTS 9 15 0 800
150313005 Eter.nal A March 21, 2022, 1:12 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150325456 madara_uchiha1245 A March 21, 2022, 5:46 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150319555 acw_kat A March 21, 2022, 4:21 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150318777 iLLusio A March 21, 2022, 4:01 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150315636 2020012124 A March 21, 2022, 2:39 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150315045 mashed_aloo A March 21, 2022, 2:22 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150314663 izumiQR A March 21, 2022, 2:10 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150314571 thilio A March 21, 2022, 2:07 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150313406 Lascym0331 A March 21, 2022, 1:27 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150311974 Kidding_Ma A March 21, 2022, 12:37 a.m. OK GNU C++17 (64) TESTS 9 15 0 800
150285018 CIiii A March 20, 2022, 4:24 p.m. OK GNU C++20 (64) TESTS 9 0 1638400 800
150325408 XORcist A March 21, 2022, 5:45 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150325283 KMBR A March 21, 2022, 5:43 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150324711 ArPiT_PanDeY A March 21, 2022, 5:33 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150322459 yashp_ A March 21, 2022, 5:17 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150321131 tloinuy A March 21, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150321115 rohit_7 A March 21, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150321093 AhmedFahmy A March 21, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150325912 Nova_Adi A March 21, 2022, 5:53 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150325765 aryan183 A March 21, 2022, 5:51 a.m. OK GNU C++20 (64) TESTS 9 15 0 800
150293400 koqo A March 20, 2022, 6:01 p.m. OK Go TESTS 9 62 819200 800
150264268 haminh02 A March 20, 2022, 1:19 p.m. OK Go TESTS 9 1404 2048000 800
150306887 lock_infinity A March 20, 2022, 9:57 p.m. OK Java 11 TESTS 9 171 0 800
150304781 shamil A March 20, 2022, 9:05 p.m. OK Java 11 TESTS 9 171 0 800
150315782 akashkumarkly A March 21, 2022, 2:43 a.m. OK Java 11 TESTS 9 171 0 800
150312136 peterpeterp A March 21, 2022, 12:42 a.m. OK Java 11 TESTS 9 171 0 800
150289956 _ryan18_ A March 20, 2022, 5:20 p.m. OK Java 11 TESTS 9 186 0 800
150325933 pratham_b A March 21, 2022, 5:53 a.m. OK Java 11 TESTS 9 186 0 800
150301025 Eslam_Ahmed A March 20, 2022, 7:52 p.m. OK Java 11 TESTS 9 186 0 800
150292184 flyroko A March 20, 2022, 5:45 p.m. OK Java 11 TESTS 9 186 0 800
150325994 SaberXpro A March 21, 2022, 5:54 a.m. OK Java 11 TESTS 9 187 0 800
150303132 galaxi A March 20, 2022, 8:30 p.m. OK Java 11 TESTS 9 187 0 800
150301130 sthelmo A March 20, 2022, 7:54 p.m. OK Java 8 TESTS 9 93 0 800
150300338 Kritika717 A March 20, 2022, 7:41 p.m. OK Java 8 TESTS 9 108 0 800
150278155 Mohamed_A7med A March 20, 2022, 3:13 p.m. OK Java 8 TESTS 9 108 0 800
150279917 ved20 A March 20, 2022, 3:30 p.m. OK Java 8 TESTS 9 108 0 800
150276472 di_halt A March 20, 2022, 2:59 p.m. OK Java 8 TESTS 9 108 0 800
150315007 lcheeme1 A March 21, 2022, 2:21 a.m. OK Java 8 TESTS 9 108 0 800
150313557 zhong123456 A March 21, 2022, 1:33 a.m. OK Java 8 TESTS 9 109 0 800
150301489 Yehia8 A March 20, 2022, 8 p.m. OK Java 8 TESTS 9 109 0 800
150321318 Phenom110 A March 21, 2022, 4:58 a.m. OK Java 8 TESTS 9 109 0 800
150320422 RR2000 A March 21, 2022, 4:40 a.m. OK Java 8 TESTS 9 109 0 800
150280041 SlavaG A March 20, 2022, 3:31 p.m. OK Kotlin 1.5 TESTS 9 249 1126400 800
150270301 Timoniche A March 20, 2022, 1:46 p.m. OK Kotlin 1.5 TESTS 9 264 921600 800
150296090 Damirca A March 20, 2022, 6:37 p.m. OK MS C++ 2017 TESTS 9 31 0 800
150319109 bai1013 A March 21, 2022, 4:10 a.m. OK MS C++ 2017 TESTS 9 31 0 800
150286276 Ayman_Attili26 A March 20, 2022, 4:38 p.m. OK MS C++ 2017 TESTS 9 46 0 800
150268728 vikas.pachisia A March 20, 2022, 1:39 p.m. OK MS C++ 2017 TESTS 9 46 0 800
150301686 Gadi A March 20, 2022, 8:03 p.m. OK MS C++ 2017 TESTS 9 46 0 800
150284812 kriksnonsi A March 20, 2022, 4:21 p.m. OK MS C++ 2017 TESTS 9 46 0 800
150264167 DmtrPpl A March 20, 2022, 1:19 p.m. OK MS C++ 2017 TESTS 9 61 0 800
150317563 capability_Wu A March 21, 2022, 3:30 a.m. OK MS C++ 2017 TESTS 9 61 0 800
150314140 edfearay11 A March 21, 2022, 1:53 a.m. OK MS C++ 2017 TESTS 9 61 0 800
150311663 forgotmyhandle A March 21, 2022, 12:25 a.m. OK MS C++ 2017 TESTS 9 62 0 800
150287088 suraj A March 20, 2022, 4:47 p.m. OK .NET Core C# TESTS 9 77 3276800 800
150282306 gorg_sg A March 20, 2022, 3:54 p.m. OK .NET Core C# TESTS 9 93 3174400 800
150264543 Remi380 A March 20, 2022, 1:20 p.m. OK Ocaml TESTS 9 31 102400 800
150308124 coden00b2021 A March 20, 2022, 10:31 p.m. OK PyPy 2 TESTS 9 93 819200 800
150279773 souva_6112000 A March 20, 2022, 3:28 p.m. OK PyPy 3 TESTS 9 108 3788800 800
150283872 Adolf988 A March 20, 2022, 4:11 p.m. OK PyPy 3 TESTS 9 108 4096000 800
150286381 erudition_0705 A March 20, 2022, 4:39 p.m. OK PyPy 3 TESTS 9 109 3788800 800
150283106 kwin A March 20, 2022, 4:02 p.m. OK PyPy 3 TESTS 9 109 3891200 800
150299370 legend.ary_as A March 20, 2022, 7:25 p.m. OK PyPy 3 TESTS 9 109 4300800 800
150279171 __J__ A March 20, 2022, 3:22 p.m. OK PyPy 3 TESTS 9 124 3891200 800
150321989 akshat11 A March 21, 2022, 5:09 a.m. OK PyPy 3 TESTS 9 124 3993600 800
150297382 Techcoder A March 20, 2022, 6:55 p.m. OK PyPy 3 TESTS 9 171 6144000 800
150288390 Ayushman_123 A March 20, 2022, 5:02 p.m. OK PyPy 3 TESTS 9 218 6860800 800
150298739 A_M__T A March 20, 2022, 7:16 p.m. OK PyPy 3 TESTS 9 233 7680000 800
150292777 nitish420 A March 20, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 9 62 3686400 800
150320048 raushnn A March 21, 2022, 4:32 a.m. OK PyPy 3-64 TESTS 9 62 3993600 800
150319669 notTehlka A March 21, 2022, 4:24 a.m. OK PyPy 3-64 TESTS 9 77 3686400 800
150312196 NKUCristiano A March 21, 2022, 12:44 a.m. OK PyPy 3-64 TESTS 9 77 3686400 800
150274901 only_for_kav_tripathi A March 20, 2022, 2:49 p.m. OK PyPy 3-64 TESTS 9 78 2969600 800
150294524 User0286 A March 20, 2022, 6:15 p.m. OK PyPy 3-64 TESTS 9 93 4812800 800
150313826 Youarenotgood A March 21, 2022, 1:42 a.m. OK PyPy 3-64 TESTS 9 93 5017600 800
150305303 omarnvidia A March 20, 2022, 9:18 p.m. OK PyPy 3-64 TESTS 9 93 5120000 800
150322456 mmooyyii A March 21, 2022, 5:17 a.m. OK PyPy 3-64 TESTS 9 93 5427200 800
150315040 happywater A March 21, 2022, 2:22 a.m. OK PyPy 3-64 TESTS 9 93 5427200 800
150291496 FYS A March 20, 2022, 5:37 p.m. OK Python 3 TESTS 9 46 204800 800
150288259 Aadithyan A March 20, 2022, 5 p.m. OK Python 3 TESTS 9 46 204800 800
150281909 sasidhar_reddy_18 A March 20, 2022, 3:50 p.m. OK Python 3 TESTS 9 46 204800 800
150318212 Block_Cipher A March 21, 2022, 3:46 a.m. OK Python 3 TESTS 9 46 204800 800
150316153 a8829037 A March 21, 2022, 2:53 a.m. OK Python 3 TESTS 9 46 204800 800
150320124 ToughestNailEver A March 21, 2022, 4:34 a.m. OK Python 3 TESTS 9 46 307200 800
150319616 Ratree A March 21, 2022, 4:23 a.m. OK Python 3 TESTS 9 46 307200 800
150314043 husnain A March 21, 2022, 1:50 a.m. OK Python 3 TESTS 9 46 307200 800
150296007 Mueez_073 A March 20, 2022, 6:36 p.m. OK Python 3 TESTS 9 46 307200 800
150295798 nishant_kumar A March 20, 2022, 6:33 p.m. OK Python 3 TESTS 9 46 307200 800
150260982 Shinonome_Ena A March 20, 2022, 1:03 p.m. OK Rust 2021 TESTS 9 15 0 800

remove filters

Back to search problems