Codeforces Round 672 (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
1420 Codeforces Round 672 (Div. 2) FINISHED False 7200 136394711 Sept. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17863 ) C1 Pokémon Army (easy version) PROGRAMMING constructive algorithms dp greedy

B'This is the easy version of the problem. The difference between the versions is that the easy version has no swap operations. You can make hacks only if all versions of the problem are solved. Pikachu is a cute and friendly pok xc3 xa9mon living in the wild pikachu herd. But it has become known recently that infamous team R wanted to steal all these pok xc3 xa9mon! Pok xc3 xa9mon trainer Andrew decided to help Pikachu to build a pok xc3 xa9mon army to resist. First, Andrew counted all the pok xc3 xa9mon -- there were exactly n pikachu. The strength of the i -th pok xc3 xa9mon is equal to a_i , and all these numbers are distinct. As an army, Andrew can choose any non-empty subsequence of pokemons. In other words, Andrew chooses some array b from k indices such that 1 <= b_1 < b_2 < ... < b_k <= n , and his army will consist of pok xc3 xa9mons with forces a_{b_1}, a_{b_2}, ... , a_{b_k} . The strength of the army is equal to the alternating sum of elements of the subsequence; that is, a_{b_1} - a_{b_2} + a_{b_3} - a_{b_4} + ... . Andrew is experimenting with pok xc3 xa9mon order. He performs q operations. In i -th operation Andrew swaps l_i -th and r_i -th pok xc3 xa9mon. Note: q=0 in this version of the task. Andrew wants to know the maximal stregth of the army he can achieve with the initial pok xc3 xa9mon placement. He also needs to know the maximal strength after each operation. Help Andrew and the pok xc3 xa9mon, or team R will realize their tricky plan! Each test contains multiple test cases. The first line contains one positive integer t ( 1 <= t <= 10^3 ) denoting the number of test cases. Description of the test cases follows. The first line of each test case contains two integers n and q ( 1 <= n <= 3 cdot 10^5, q = 0 ) denoting the number of pok xc3 xa9mon and number of operations respectively. The second line contains n distinct positive integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) denoti'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93711315 Just_Matvey C1 Sept. 24, 2020, 4:17 p.m. OK Delphi TESTS 30 249 6041600
93732038 amanj5486 C1 Sept. 24, 2020, 8:14 p.m. OK GNU C11 TESTS 30 62 1228800
93741738 STDquantum C1 Sept. 25, 2020, 1:51 a.m. OK GNU C++11 TESTS 30 31 0
93745122 sunzihao C1 Sept. 25, 2020, 3:16 a.m. OK GNU C++11 TESTS 30 31 1228800
93740984 stone41123 C1 Sept. 25, 2020, 1:28 a.m. OK GNU C++11 TESTS 30 31 1228800
93739757 Contna C1 Sept. 25, 2020, 12:45 a.m. OK GNU C++11 TESTS 30 31 1228800
93750276 Contna C1 Sept. 25, 2020, 5 a.m. OK GNU C++11 TESTS 30 31 2457600
93742540 STDquantum C1 Sept. 25, 2020, 2:12 a.m. OK GNU C++11 TESTS 30 46 1228800
93751827 Zechariah_2001 C1 Sept. 25, 2020, 5:26 a.m. OK GNU C++11 TESTS 30 46 1228800
93743215 chengni C1 Sept. 25, 2020, 2:30 a.m. OK GNU C++11 TESTS 30 46 2457600
93714389 XUANSE C1 Sept. 24, 2020, 4:26 p.m. OK GNU C++11 TESTS 30 46 3584000
93729832 Pccc C1 Sept. 24, 2020, 7:33 p.m. OK GNU C++11 TESTS 30 46 3993600
93728525 costheta_z C1 Sept. 24, 2020, 7:14 p.m. OK GNU C++14 TESTS 30 93 0
93752416 aanand_23 C1 Sept. 25, 2020, 5:35 a.m. OK GNU C++14 TESTS 30 93 0
93714777 anyingshougezhe C1 Sept. 24, 2020, 4:27 p.m. OK GNU C++14 TESTS 30 93 1126400
93751325 Ah_naf C1 Sept. 25, 2020, 5:17 a.m. OK GNU C++14 TESTS 30 93 1228800
93749042 aryanrathee C1 Sept. 25, 2020, 4:37 a.m. OK GNU C++14 TESTS 30 93 1228800
93746809 monaal C1 Sept. 25, 2020, 3:50 a.m. OK GNU C++14 TESTS 30 93 1228800
93746670 monaal C1 Sept. 25, 2020, 3:47 a.m. OK GNU C++14 TESTS 30 93 1228800
93751905 fiery_raptor C1 Sept. 25, 2020, 5:27 a.m. OK GNU C++14 TESTS 30 93 1228800
93739173 Rebro C1 Sept. 25, 2020, 12:24 a.m. OK GNU C++14 TESTS 30 93 1228800
93741286 _Binary_Search_ C1 Sept. 25, 2020, 1:38 a.m. OK GNU C++14 TESTS 30 93 1228800
93742367 chen_zexing C1 Sept. 25, 2020, 2:08 a.m. OK GNU C++17 TESTS 30 77 1228800
93726223 Rh370170 C1 Sept. 24, 2020, 6:45 p.m. OK GNU C++17 TESTS 30 77 2355200
93711107 HKvv C1 Sept. 24, 2020, 4:16 p.m. OK GNU C++17 TESTS 30 77 16076800
93713672 Shtubbb C1 Sept. 24, 2020, 4:24 p.m. OK GNU C++17 TESTS 30 93 0
93738463 whywyh C1 Sept. 24, 2020, 11:52 p.m. OK GNU C++17 TESTS 30 93 0
93735453 mahatejvarma C1 Sept. 24, 2020, 9:40 p.m. OK GNU C++17 TESTS 30 93 0
93733469 unstoppable_N C1 Sept. 24, 2020, 8:45 p.m. OK GNU C++17 TESTS 30 93 0
93731000 penguinhacker C1 Sept. 24, 2020, 7:54 p.m. OK GNU C++17 TESTS 30 93 0
93730301 rspr C1 Sept. 24, 2020, 7:41 p.m. OK GNU C++17 TESTS 30 93 0
93729976 timf1089 C1 Sept. 24, 2020, 7:36 p.m. OK GNU C++17 TESTS 30 93 0
93751299 axat0081 C1 Sept. 25, 2020, 5:17 a.m. OK GNU C++17 (64) TESTS 30 46 12185600
93721496 marmot0814 C1 Sept. 24, 2020, 6:05 p.m. OK GNU C++17 (64) TESTS 30 61 1228800
93745759 marcos_999 C1 Sept. 25, 2020, 3:28 a.m. OK GNU C++17 (64) TESTS 30 61 2457600
93749067 dhiraj-01 C1 Sept. 25, 2020, 4:37 a.m. OK GNU C++17 (64) TESTS 30 62 0
93735639 ankushkhanna C1 Sept. 24, 2020, 9:46 p.m. OK GNU C++17 (64) TESTS 30 62 0
93739222 Jame___boy C1 Sept. 25, 2020, 12:25 a.m. OK GNU C++17 (64) TESTS 30 62 1228800
93744731 Clu3l3ss C1 Sept. 25, 2020, 3:08 a.m. OK GNU C++17 (64) TESTS 30 62 1228800
93744483 heyuhhh C1 Sept. 25, 2020, 3:01 a.m. OK GNU C++17 (64) TESTS 30 62 1228800
93742047 m.hasan01 C1 Sept. 25, 2020, 1:59 a.m. OK GNU C++17 (64) TESTS 30 62 1228800
93739917 Gats C1 Sept. 25, 2020, 12:52 a.m. OK GNU C++17 (64) TESTS 30 62 1228800
93714115 meooow C1 Sept. 24, 2020, 4:25 p.m. OK Go TESTS 30 108 69222400
93750787 CoronaTime C1 Sept. 25, 2020, 5:09 a.m. OK Java 11 TESTS 30 202 0
93731060 DreamInfinite C1 Sept. 24, 2020, 7:55 p.m. OK Java 11 TESTS 30 202 0
93743205 tusharjape007 C1 Sept. 25, 2020, 2:30 a.m. OK Java 11 TESTS 30 218 0
93742186 qlf9 C1 Sept. 25, 2020, 2:04 a.m. OK Java 11 TESTS 30 218 0
93731929 Elgeziry C1 Sept. 24, 2020, 8:12 p.m. OK Java 11 TESTS 30 218 0
93733036 dkcs C1 Sept. 24, 2020, 8:35 p.m. OK Java 11 TESTS 30 218 1536000
93724116 gssakash C1 Sept. 24, 2020, 6:23 p.m. OK Java 11 TESTS 30 233 0
93729131 HastaLaVistaLa C1 Sept. 24, 2020, 7:23 p.m. OK Java 11 TESTS 30 233 4710400
93733078 alimodassir C1 Sept. 24, 2020, 8:36 p.m. OK Java 11 TESTS 30 249 1536000
93723447 vaishnav_firebolt C1 Sept. 24, 2020, 6:17 p.m. OK Java 11 TESTS 30 264 0
93753275 zayn8917 C1 Sept. 25, 2020, 5:48 a.m. OK Java 8 TESTS 30 139 0
93745956 Pranay2516 C1 Sept. 25, 2020, 3:32 a.m. OK Java 8 TESTS 30 139 0
93713585 ragnarok001 C1 Sept. 24, 2020, 4:23 p.m. OK Java 8 TESTS 30 155 1740800
93745458 abhinav74 C1 Sept. 25, 2020, 3:22 a.m. OK Java 8 TESTS 30 155 2764800
93730546 ImFish C1 Sept. 24, 2020, 7:46 p.m. OK Java 8 TESTS 30 155 2764800
93714723 jagrit_07 C1 Sept. 24, 2020, 4:27 p.m. OK Java 8 TESTS 30 155 2764800
93752130 mr_coder1 C1 Sept. 25, 2020, 5:30 a.m. OK Java 8 TESTS 30 170 2764800
93745062 abhinav74 C1 Sept. 25, 2020, 3:15 a.m. OK Java 8 TESTS 30 171 2764800
93744339 abhinav74 C1 Sept. 25, 2020, 2:58 a.m. OK Java 8 TESTS 30 171 2764800
93743582 sankcan55 C1 Sept. 25, 2020, 2:40 a.m. OK Java 8 TESTS 30 171 2764800
93751743 shebao C1 Sept. 25, 2020, 5:25 a.m. OK MS C++ 2017 TESTS 30 93 1228800
93739972 PdrEam C1 Sept. 25, 2020, 12:54 a.m. OK MS C++ 2017 TESTS 30 93 2457600
93741943 Notenough C1 Sept. 25, 2020, 1:56 a.m. OK MS C++ 2017 TESTS 30 109 2048000
93733897 Wolf_Cub C1 Sept. 24, 2020, 8:55 p.m. OK MS C++ 2017 TESTS 30 233 1228800
93717739 Nitika30 C1 Sept. 24, 2020, 4:34 p.m. OK MS C++ 2017 TESTS 30 249 2457600
93713466 Myao C1 Sept. 24, 2020, 4:23 p.m. OK MS C++ 2017 TESTS 30 249 2457600
93714943 jonitox C1 Sept. 24, 2020, 4:27 p.m. OK MS C++ 2017 TESTS 30 249 7270400
93711633 Present C1 Sept. 24, 2020, 4:18 p.m. OK MS C++ 2017 TESTS 30 249 7270400
93722564 ustaritz C1 Sept. 24, 2020, 6:11 p.m. OK MS C++ 2017 TESTS 30 264 1228800
93748771 songjunwei C1 Sept. 25, 2020, 4:31 a.m. OK MS C++ 2017 TESTS 30 264 2457600
93721710 beethoven97 C1 Sept. 24, 2020, 6:06 p.m. OK PyPy 2 TESTS 30 327 37376000
93751844 Anuranjan_Pandey C1 Sept. 25, 2020, 5:26 a.m. OK PyPy 3 TESTS 30 217 23040000
93712131 sanjeevkumar113f C1 Sept. 24, 2020, 4:19 p.m. OK PyPy 3 TESTS 30 234 26419200
93752591 chandureddyn5 C1 Sept. 25, 2020, 5:38 a.m. OK PyPy 3 TESTS 30 248 21913600
93743883 dutt_shouvik C1 Sept. 25, 2020, 2:47 a.m. OK PyPy 3 TESTS 30 327 22937600
93748839 sainad C1 Sept. 25, 2020, 4:33 a.m. OK PyPy 3 TESTS 30 342 22937600
93728591 sexy_launda C1 Sept. 24, 2020, 7:15 p.m. OK PyPy 3 TESTS 30 342 22937600
93739656 bit_2 C1 Sept. 25, 2020, 12:41 a.m. OK PyPy 3 TESTS 30 342 26726400
93738936 zimpZamp C1 Sept. 25, 2020, 12:15 a.m. OK PyPy 3 TESTS 30 342 26726400
93726046 adiranjan63 C1 Sept. 24, 2020, 6:42 p.m. OK PyPy 3 TESTS 30 343 20377600
93740163 Code_Breaker C1 Sept. 25, 2020, 1:01 a.m. OK PyPy 3 TESTS 30 343 26624000
93749294 adi112100 C1 Sept. 25, 2020, 4:41 a.m. OK Python 3 TESTS 30 265 20787200
93711122 Rishi_1311 C1 Sept. 24, 2020, 4:16 p.m. OK Python 3 TESTS 30 296 21196800
93748852 programmer_neo C1 Sept. 25, 2020, 4:33 a.m. OK Python 3 TESTS 30 327 20992000
93715733 kihyo C1 Sept. 24, 2020, 4:29 p.m. OK Python 3 TESTS 30 342 20787200
93714265 Jaydeep9979 C1 Sept. 24, 2020, 4:25 p.m. OK Python 3 TESTS 30 358 20787200
93748189 deepcoder_B C1 Sept. 25, 2020, 4:20 a.m. OK Python 3 TESTS 30 358 21401600
93747945 maukaHAI C1 Sept. 25, 2020, 4:15 a.m. OK Python 3 TESTS 30 358 21401600
93724066 ranjithm2001 C1 Sept. 24, 2020, 6:22 p.m. OK Python 3 TESTS 30 373 20787200
93747760 noisegain C1 Sept. 25, 2020, 4:11 a.m. OK Python 3 TESTS 30 374 16179200
93748525 laskdkmg C1 Sept. 25, 2020, 4:26 a.m. OK Python 3 TESTS 30 374 20787200
93738206 o2c C1 Sept. 24, 2020, 11:39 p.m. OK Rust TESTS 30 62 10240000
93742008 bqn C1 Sept. 25, 2020, 1:59 a.m. OK Rust TESTS 30 93 15052800
93738326 sansen C1 Sept. 24, 2020, 11:46 p.m. OK Rust TESTS 30 93 45875200

remove filters

Back to search problems