Codeforces LATOKEN Round 1 (Div. 1 + 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
1534 Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) FINISHED False 10800 108224699 June 13, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12528 ) B Histogram Ugliness PROGRAMMING greedy implementation math

B"Little Dormi received a histogram with n bars of height a_1, a_2, ldots, a_n for Christmas. However, the more he played with his new histogram, the more he realized its imperfections, so today he wanted to modify it to his liking. To modify the histogram, Little Dormi is able to perform the following operation an arbitrary number of times: Little Dormi defines the ugliness score of his histogram (after performing some number of operations) as the sum of the vertical length of its outline and the number of operations he performed on it. And to make the histogram as perfect as possible, he would like to minimize the ugliness score after modifying it with some number of operations. However, as his histogram is very large, Little Dormi is having trouble minimizing the ugliness score, so as Little Dormi's older brother, help him find the minimal ugliness. Consider the following example where the histogram has 4 columns of heights 4,8,9,6 : The blue region represents the histogram, and the red lines represent the vertical portion of the outline. Currently, the vertical length of the outline is 4+4+1+3+6 = 18 , so if Little Dormi does not modify the histogram at all, the ugliness would be 18 . However, Little Dormi can apply the operation once on column 2 and twice on column 3 , resulting in a histogram with heights 4,7,7,6 : Now, as the total vertical length of the outline (red lines) is 4+3+1+6=14 , the ugliness is 14+3=17 dollars. It can be proven that this is optimal. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 4 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases"...

Tutorials

Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
119409429 cutx64 B June 14, 2021, 1:35 a.m. OK D TESTS 20 140 21913600
119392625 deepthi004 B June 13, 2021, 6:19 p.m. OK GNU C11 TESTS 20 124 3174400
119388401 Varun_190030954 B June 13, 2021, 6:02 p.m. OK GNU C11 TESTS 20 140 3174400
119387530 BL_HLD B June 13, 2021, 5:58 p.m. OK GNU C++11 TESTS 20 31 1638400
119409929 pzc2004 B June 14, 2021, 1:51 a.m. OK GNU C++11 TESTS 20 31 1638400
119389866 lzj12345 B June 13, 2021, 6:08 p.m. OK GNU C++11 TESTS 20 46 3072000
119409809 zhoumofei B June 14, 2021, 1:48 a.m. OK GNU C++11 TESTS 20 46 3174400
119407837 Werner_Yin B June 14, 2021, 12:18 a.m. OK GNU C++11 TESTS 20 46 3174400
119408423 use_fft B June 14, 2021, 12:51 a.m. OK GNU C++11 TESTS 20 46 3174400
119414258 Aestas16 B June 14, 2021, 3:38 a.m. OK GNU C++11 TESTS 20 46 3174400
119414674 xythq B June 14, 2021, 3:47 a.m. OK GNU C++11 TESTS 20 46 6451200
119405539 yspm B June 13, 2021, 10:04 p.m. OK GNU C++11 TESTS 20 46 7987200
119416717 xwp B June 14, 2021, 4:27 a.m. OK GNU C++11 TESTS 20 46 18022400
119406111 Mohammad.Nour B June 13, 2021, 10:31 p.m. OK GNU C++14 TESTS 20 109 4505600
119419735 call_me_veer B June 14, 2021, 5:20 a.m. OK GNU C++14 TESTS 20 124 1638400
119407473 MichaelHyh B June 13, 2021, 11:58 p.m. OK GNU C++14 TESTS 20 124 1638400
119406484 Uninvited_Guest B June 13, 2021, 10:53 p.m. OK GNU C++14 TESTS 20 124 1638400
119403371 xt0r3 B June 13, 2021, 8:54 p.m. OK GNU C++14 TESTS 20 124 1638400
119401781 sayantan13 B June 13, 2021, 8:15 p.m. OK GNU C++14 TESTS 20 124 1638400
119400781 Ani222001 B June 13, 2021, 8 p.m. OK GNU C++14 TESTS 20 124 1638400
119395762 anuami B June 13, 2021, 6:30 p.m. OK GNU C++14 TESTS 20 124 1638400
119418311 Volts B June 14, 2021, 4:56 a.m. OK GNU C++14 TESTS 20 124 1638400
119418740 math_id B June 14, 2021, 5:03 a.m. OK GNU C++14 TESTS 20 124 1638400
119409720 OrlKorrekt B June 14, 2021, 1:45 a.m. OK GNU C++17 TESTS 20 31 1638400
119420758 geospiza B June 14, 2021, 5:35 a.m. OK GNU C++17 TESTS 20 124 1638400
119422389 kalit-31 B June 14, 2021, 5:57 a.m. OK GNU C++17 TESTS 20 124 1638400
119422335 Erasylll B June 14, 2021, 5:57 a.m. OK GNU C++17 TESTS 20 124 1638400
119421111 shuklaaditya B June 14, 2021, 5:41 a.m. OK GNU C++17 TESTS 20 124 1638400
119420044 shrii_06 B June 14, 2021, 5:25 a.m. OK GNU C++17 TESTS 20 124 1638400
119419932 _Joy_ B June 14, 2021, 5:23 a.m. OK GNU C++17 TESTS 20 124 1638400
119419363 no_words_to_sky B June 14, 2021, 5:14 a.m. OK GNU C++17 TESTS 20 124 1638400
119418481 pradumn B June 14, 2021, 4:59 a.m. OK GNU C++17 TESTS 20 124 1638400
119415660 LONG__INT B June 14, 2021, 4:07 a.m. OK GNU C++17 TESTS 20 124 1638400
119405905 JohnSmith0081 B June 13, 2021, 10:20 p.m. OK GNU C++17 (64) TESTS 20 46 11161600
119401626 dhru008 B June 13, 2021, 8:12 p.m. OK GNU C++17 (64) TESTS 20 77 3174400
119405758 rebel_roar B June 13, 2021, 10:13 p.m. OK GNU C++17 (64) TESTS 20 77 3174400
119411746 whohet B June 14, 2021, 2:44 a.m. OK GNU C++17 (64) TESTS 20 77 3788800
119404514 brkdnmz B June 13, 2021, 9:25 p.m. OK GNU C++17 (64) TESTS 20 78 1638400
119400380 saurabhkulkarni B June 13, 2021, 7:56 p.m. OK GNU C++17 (64) TESTS 20 78 3174400
119417686 Chet8n B June 14, 2021, 4:44 a.m. OK GNU C++17 (64) TESTS 20 78 3174400
119406491 honkk B June 13, 2021, 10:53 p.m. OK GNU C++17 (64) TESTS 20 78 3174400
119417697 WinterFlowers_ B June 14, 2021, 4:45 a.m. OK GNU C++17 (64) TESTS 20 92 1638400
119417947 ishanmakkar B June 14, 2021, 4:49 a.m. OK GNU C++17 (64) TESTS 20 92 3174400
119407714 adarsh_goku B June 14, 2021, 12:11 a.m. OK Java 11 TESTS 20 265 13414400
119394576 Kunal_30 B June 13, 2021, 6:26 p.m. OK Java 11 TESTS 20 280 0
119410705 ankit_bit B June 14, 2021, 2:15 a.m. OK Java 11 TESTS 20 280 13312000
119413855 Tharun0102 B June 14, 2021, 3:30 a.m. OK Java 11 TESTS 20 280 13414400
119411024 tushar19280 B June 14, 2021, 2:24 a.m. OK Java 11 TESTS 20 280 13516800
119408976 _Body B June 14, 2021, 1:18 a.m. OK Java 11 TESTS 20 280 15872000
119401374 ryanranaut B June 13, 2021, 8:08 p.m. OK Java 11 TESTS 20 295 13312000
119399630 future_me B June 13, 2021, 7:51 p.m. OK Java 11 TESTS 20 295 13721600
119407238 Yuxiang B June 13, 2021, 11:41 p.m. OK Java 11 TESTS 20 296 13414400
119402211 pdk.abhishek B June 13, 2021, 8:22 p.m. OK Java 11 TESTS 20 311 13414400
119400763 smahajan54842 B June 13, 2021, 8 p.m. OK Java 8 TESTS 20 155 0
119391528 Abhishek_patel_ B June 13, 2021, 6:15 p.m. OK Java 8 TESTS 20 155 0
119386877 tarun_sm B June 13, 2021, 5:55 p.m. OK Java 8 TESTS 20 186 0
119386866 kzhang2012 B June 13, 2021, 5:55 p.m. OK Java 8 TESTS 20 187 29286400
119414489 shubhamsb25 B June 14, 2021, 3:44 a.m. OK Java 8 TESTS 20 202 29900800
119402399 Gupta-OP B June 13, 2021, 8:26 p.m. OK Java 8 TESTS 20 202 29900800
119422544 gssakash B June 14, 2021, 5:59 a.m. OK Java 8 TESTS 20 217 33177600
119397618 ChiMasterBing B June 13, 2021, 6:34 p.m. OK Java 8 TESTS 20 218 33177600
119411494 Dcoder123 B June 14, 2021, 2:38 a.m. OK Java 8 TESTS 20 249 33075200
119388069 spambell B June 13, 2021, 6 p.m. OK Java 8 TESTS 20 249 38707200
119407297 Spheniscine B June 13, 2021, 11:45 p.m. OK Kotlin TESTS 20 186 0
119399473 roman.dzhadan B June 13, 2021, 7:50 p.m. OK Kotlin TESTS 20 280 30720000
119414490 luctivud B June 14, 2021, 3:44 a.m. OK Kotlin TESTS 20 514 42188800
119408517 VAAB_V23 B June 14, 2021, 12:55 a.m. OK MS C++ 2017 TESTS 20 374 3174400
119389988 Ash_2k B June 13, 2021, 6:09 p.m. OK MS C++ 2017 TESTS 20 404 3891200
119393835 Alenochka B June 13, 2021, 6:24 p.m. OK MS C++ 2017 TESTS 20 420 0
119421640 David01012000 B June 14, 2021, 5:48 a.m. OK MS C++ 2017 TESTS 20 436 0
119399823 Ilyaiq300 B June 13, 2021, 7:52 p.m. OK MS C++ 2017 TESTS 20 452 3174400
119393362 Swapnil_Vaish B June 13, 2021, 6:22 p.m. OK MS C++ 2017 TESTS 20 467 7987200
119402701 henrychenOutlook B June 13, 2021, 8:33 p.m. OK Node.js TESTS 20 311 35840000
119402132 henrychenOutlook B June 13, 2021, 8:21 p.m. OK Node.js TESTS 20 373 35942400
119390626 marilova B June 13, 2021, 6:11 p.m. OK PascalABC.NET TESTS 20 841 2048000
119407043 lebron87 B June 13, 2021, 11:25 p.m. OK PyPy 2 TESTS 20 358 29184000
119407436 gkz B June 13, 2021, 11:56 p.m. OK PyPy 2 TESTS 20 420 20070400
119394604 KanishkGoel B June 13, 2021, 6:27 p.m. OK PyPy 3 TESTS 20 248 38195200
119401363 gourav2001k B June 13, 2021, 8:08 p.m. OK PyPy 3 TESTS 20 327 38400000
119400655 pk31299 B June 13, 2021, 7:58 p.m. OK PyPy 3 TESTS 20 358 41267200
119419060 rivnam B June 14, 2021, 5:09 a.m. OK PyPy 3 TESTS 20 374 38195200
119399545 harshitkapoor B June 13, 2021, 7:50 p.m. OK PyPy 3 TESTS 20 530 35430400
119392020 ZzaZi B June 13, 2021, 6:17 p.m. OK PyPy 3 TESTS 20 560 37580800
119388070 MILOY B June 13, 2021, 6 p.m. OK PyPy 3 TESTS 20 576 45260800
119386640 bhumkong B June 13, 2021, 5:54 p.m. OK PyPy 3 TESTS 20 577 26316800
119390693 cocopalm B June 13, 2021, 6:12 p.m. OK PyPy 3 TESTS 20 592 32665600
119386511 Sameer-Mann B June 13, 2021, 5:54 p.m. OK PyPy 3 TESTS 20 592 34304000
119412142 eugalt B June 14, 2021, 2:53 a.m. OK Python 3 TESTS 20 545 25190400
119411663 eugalt B June 14, 2021, 2:42 a.m. OK Python 3 TESTS 20 545 25190400
119409426 aman2000jaiswal14 B June 14, 2021, 1:35 a.m. OK Python 3 TESTS 20 546 31232000
119400141 Kimmel B June 13, 2021, 7:54 p.m. OK Python 3 TESTS 20 546 31846400
119409825 eugalt B June 14, 2021, 1:48 a.m. OK Python 3 TESTS 20 561 25702400
119392136 juvelop17 B June 13, 2021, 6:17 p.m. OK Python 3 TESTS 20 592 31232000
119402763 eugalt B June 13, 2021, 8:35 p.m. OK Python 3 TESTS 20 639 36761600
119400436 peakypo B June 13, 2021, 7:56 p.m. OK Python 3 TESTS 20 670 31232000
119391465 themvp B June 13, 2021, 6:14 p.m. OK Python 3 TESTS 20 670 31948800
119400159 eugalt B June 13, 2021, 7:54 p.m. OK Python 3 TESTS 20 670 36761600
119414602 cottoncotton B June 14, 2021, 3:46 a.m. OK Rust TESTS 20 46 9932800
119405942 TFTM B June 13, 2021, 10:22 p.m. OK Rust TESTS 20 217 1638400
119407525 IvanDyachenko B June 14, 2021, 12:01 a.m. OK Scala TESTS 20 686 38707200
119407630 IvanDyachenko B June 14, 2021, 12:07 a.m. OK Scala TESTS 20 717 38707200
119407597 IvanDyachenko B June 14, 2021, 12:04 a.m. OK Scala TESTS 20 733 38707200

remove filters

Back to search problems