Codeforces Round 407 (Div. 1)

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
788 Codeforces Round 407 (Div. 1) FINISHED False 7200 246722124 March 29, 2017, 4:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9202 ) A Functions again PROGRAMMING dp two pointers 1500

B'Something happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Upon the arriving, they found that citizens are worried about maximum values of the Main Uzhlyandian Function f, which is defined as follows: In the above formula, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89< xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n must hold, where n is the size of the Main Uzhlyandian Array a, and |x| means absolute value of x. But the heroes skipped their math lessons in school, so they asked you for help. Help them calculate the maximum value of f among all possible values of l and r for the given array a. The first line contains single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the size of the array a. The second line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (-109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the array elements. Print the only integer -- the maximum value of f. In the first sample case, the optimal value of f is reached on intervals [1, xe2 x80 x892] and [2, xe2 x80 x895]. In the second case maximal value of f is reachable only on the whole array. '...

Tutorials

Codeforces Round #407(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
25902025 Gassa A March 29, 2017, 4:16 p.m. OK D TESTS 52 61 14540800 1500
27815136 KagamiharaNadeshiko A June 16, 2017, 2:12 a.m. OK FPC TESTS 52 46 3276800 1500
25903574 NormalCoder A March 29, 2017, 4:23 p.m. OK FPC TESTS 52 46 3276800 1500
30538028 imalhio A Sept. 20, 2017, 8:01 a.m. OK GNU C TESTS 52 31 1228800 1500
26919701 vjudge3 A May 7, 2017, 8:54 a.m. OK GNU C TESTS 52 31 1228800 1500
32962633 NoSoul A Dec. 6, 2017, 6 a.m. OK GNU C TESTS 52 31 2252800 1500
26507009 sahuang A April 20, 2017, 3:17 a.m. OK GNU C TESTS 52 31 2252800 1500
26077040 vjudge1 A April 2, 2017, 11:47 a.m. OK GNU C TESTS 52 31 2252800 1500
27203521 LbitPhantom A May 18, 2017, 7:23 p.m. OK GNU C TESTS 52 31 2457600 1500
34390242 Destr_ A Jan. 20, 2018, 6:38 p.m. OK GNU C TESTS 52 31 3072000 1500
27208021 Froz A May 19, 2017, 5:19 a.m. OK GNU C TESTS 52 31 3174400 1500
26313655 WAWAtewa A April 12, 2017, 8:46 a.m. OK GNU C TESTS 52 31 5120000 1500
26173921 jkxjkx1031 A April 6, 2017, 3:37 p.m. OK GNU C TESTS 52 46 2662400 1500
27337450 AkaneSasu A May 25, 2017, 1:17 p.m. OK GNU C++ TESTS 52 15 307200 1500
32149697 mengbierr A Nov. 9, 2017, 2:14 a.m. OK GNU C++ TESTS 52 15 1638400 1500
26254265 samjia2000 A April 10, 2017, 1:22 p.m. OK GNU C++ TESTS 52 15 2457600 1500
25901767 1919810 A March 29, 2017, 4:15 p.m. OK GNU C++ TESTS 52 15 2662400 1500
34645577 luogu_bot4 A Jan. 28, 2018, 11:34 p.m. OK GNU C++ TESTS 52 15 2867200 1500
26778506 cbhcbh A May 1, 2017, 4:19 a.m. OK GNU C++ TESTS 52 15 3686400 1500
25959827 smtcoder A March 30, 2017, 5:24 p.m. OK GNU C++ TESTS 52 15 3686400 1500
25938976 fgvfgfg1 A March 30, 2017, 2:49 a.m. OK GNU C++ TESTS 52 15 4505600 1500
30640479 Merln A Sept. 23, 2017, 11:56 a.m. OK GNU C++ TESTS 52 30 2560000 1500
27747953 zhgxxlm A June 13, 2017, 3:23 a.m. OK GNU C++ TESTS 52 30 3584000 1500
26230629 SMWang A April 9, 2017, 5:44 a.m. OK GNU C11 TESTS 52 31 2355200 1500
50925694 838889732 A March 7, 2019, 11:43 a.m. OK GNU C11 TESTS 52 31 2457600 1500
43428067 freyes A Sept. 25, 2018, 9:53 p.m. OK GNU C11 TESTS 52 46 1638400 1500
43431924 Giwan A Sept. 26, 2018, 2:10 a.m. OK GNU C11 TESTS 52 46 2355200 1500
37445683 kolic A April 18, 2018, 6:40 p.m. OK GNU C11 TESTS 52 46 6553600 1500
43430529 alexismed A Sept. 26, 2018, 12:45 a.m. OK GNU C11 TESTS 52 61 1024000 1500
43420850 freyes A Sept. 25, 2018, 5:33 p.m. OK GNU C11 TESTS 52 61 1638400 1500
43454150 dalek_cos A Sept. 26, 2018, 2:19 p.m. OK GNU C11 TESTS 52 61 2355200 1500
43433415 3t4n A Sept. 26, 2018, 3:26 a.m. OK GNU C11 TESTS 52 62 1638400 1500
26048119 cgondek A April 1, 2017, 9:13 a.m. OK GNU C++11 TESTS 52 15 2048000 1500
26046987 cgondek A April 1, 2017, 8:20 a.m. OK GNU C++11 TESTS 52 15 2048000 1500
28342760 Hermits A July 7, 2017, 6:38 a.m. OK GNU C++11 TESTS 52 15 2355200 1500
25965564 rxdoi A March 31, 2017, 12:04 a.m. OK GNU C++11 TESTS 52 15 2867200 1500
33897040 vjudge2 A Jan. 4, 2018, 6:23 a.m. OK GNU C++11 TESTS 52 15 4505600 1500
26048231 cgondek A April 1, 2017, 9:17 a.m. OK GNU C++11 TESTS 52 30 2048000 1500
25936901 LoveYayoi A March 30, 2017, 12:11 a.m. OK GNU C++11 TESTS 52 30 3686400 1500
33842417 YANG_XIAO A Jan. 1, 2018, 6:26 a.m. OK GNU C++11 TESTS 52 30 4505600 1500
25902087 flatline A March 29, 2017, 4:16 p.m. OK GNU C++11 TESTS 52 30 5427200 1500
25952229 __math A March 30, 2017, 12:34 p.m. OK GNU C++11 TESTS 52 30 6041600 1500
25901869 platypus179 A March 29, 2017, 4:16 p.m. OK GNU C++14 TESTS 52 30 23142400 1500
27906079 snek_Case A June 19, 2017, 1:53 p.m. OK GNU C++14 TESTS 52 31 819200 1500
27230719 medegor44 A May 20, 2017, 7:55 a.m. OK GNU C++14 TESTS 52 31 1228800 1500
27230656 medegor44 A May 20, 2017, 7:52 a.m. OK GNU C++14 TESTS 52 31 1228800 1500
29967735 Juno A Sept. 1, 2017, 9:16 a.m. OK GNU C++14 TESTS 52 31 2457600 1500
26522901 vanvector A April 20, 2017, 5:18 p.m. OK GNU C++14 TESTS 52 31 2662400 1500
25900869 molamola. A March 29, 2017, 4:12 p.m. OK GNU C++14 TESTS 52 31 2764800 1500
25908311 KAP A March 29, 2017, 4:41 p.m. OK GNU C++14 TESTS 52 31 2764800 1500
28988178 Jeffrey A July 30, 2017, 10:26 a.m. OK GNU C++14 TESTS 52 31 3072000 1500
25933921 gchebanov A March 29, 2017, 8:41 p.m. OK GNU C++14 TESTS 52 31 3174400 1500
43731905 201716080213 A Oct. 3, 2018, 2:26 p.m. OK GNU C++17 TESTS 52 31 2662400 1500
54755686 vjudge1 A May 28, 2019, 2:45 p.m. OK GNU C++17 TESTS 52 46 0 1500
51992625 AK. A March 29, 2019, 9:20 p.m. OK GNU C++17 TESTS 52 46 0 1500
58040655 algotron A July 30, 2019, 7:30 p.m. OK GNU C++17 TESTS 52 46 0 1500
64238215 Mai-sanBestWaifu A Nov. 4, 2019, 2:17 p.m. OK GNU C++17 TESTS 52 46 0 1500
43429526 EduardoSantos A Sept. 25, 2018, 11:31 p.m. OK GNU C++17 TESTS 52 46 409600 1500
53117673 maryamalali76 A April 22, 2019, 9:15 a.m. OK GNU C++17 TESTS 52 46 409600 1500
63359712 BugLeave A Oct. 25, 2019, 4:55 a.m. OK GNU C++17 TESTS 52 46 819200 1500
53275539 Rayaabualjamal A April 25, 2019, 9:10 a.m. OK GNU C++17 TESTS 52 46 819200 1500
64588358 rds__98 A Nov. 9, 2019, 1:59 p.m. OK GNU C++17 TESTS 52 46 819200 1500
61731954 saurabhs1206 A Oct. 2, 2019, 5 p.m. OK Java 8 TESTS 52 109 0 1500
25978239 tushar_987 A March 31, 2017, 12:22 p.m. OK Java 8 TESTS 52 109 20582400 1500
26086151 beroul A April 2, 2017, 8:27 p.m. OK Java 8 TESTS 52 109 20582400 1500
65263874 revanthreddy85 A Nov. 17, 2019, 4:01 p.m. OK Java 8 TESTS 52 124 0 1500
60286077 atharvat77 A Sept. 9, 2019, 2:33 a.m. OK Java 8 TESTS 52 124 0 1500
51048756 rohan03 A March 8, 2019, 7:52 p.m. OK Java 8 TESTS 52 124 0 1500
27352552 hitesh.bothra A May 26, 2017, 9:22 a.m. OK Java 8 TESTS 52 124 0 1500
26879697 hama-du A May 5, 2017, 12:01 p.m. OK Java 8 TESTS 52 124 0 1500
25904862 uwi A March 29, 2017, 4:28 p.m. OK Java 8 TESTS 52 124 20582400 1500
25953454 Mihir_Gajera1 A March 30, 2017, 1:15 p.m. OK Java 8 TESTS 52 124 20684800 1500
43433653 A00817810 A Sept. 26, 2018, 3:36 a.m. OK Mono C# TESTS 52 93 17100800 1500
43432621 InJoong A Sept. 26, 2018, 2:47 a.m. OK Mono C# TESTS 52 93 17100800 1500
50991251 nemars A March 7, 2019, 10:42 p.m. OK Mono C# TESTS 52 108 18841600 1500
26043964 camypaper A April 1, 2017, 5:52 a.m. OK MS C# TESTS 52 62 9830400 1500
25901652 AnatolyTolstobrov A March 29, 2017, 4:15 p.m. OK MS C# TESTS 52 62 11468800 1500
32057021 Phortox A Nov. 4, 2017, 3:16 p.m. OK MS C# TESTS 52 77 13926400 1500
35893609 zhansayaszh A March 3, 2018, 4:02 p.m. OK MS C# TESTS 52 77 21196800 1500
35893772 zhansayaszh A March 3, 2018, 4:07 p.m. OK MS C# TESTS 52 93 21196800 1500
25900692 azukun A March 29, 2017, 4:11 p.m. OK MS C# TESTS 52 93 24064000 1500
26470157 YakovPolykovsky A April 18, 2017, 6:50 a.m. OK MS C# TESTS 52 109 27238400 1500
27665908 ALWAYSWANNAFLY A June 8, 2017, 7:50 a.m. OK MS C++ TESTS 52 31 512000 1500
25938667 xcdxcdxcd A March 30, 2017, 2:23 a.m. OK MS C++ TESTS 52 31 2457600 1500
25909815 ferc A March 29, 2017, 4:46 p.m. OK MS C++ TESTS 52 31 3686400 1500
25903845 Taube A March 29, 2017, 4:24 p.m. OK MS C++ TESTS 52 31 3686400 1500
26404980 vjudge3 A April 16, 2017, 5:49 a.m. OK MS C++ TESTS 52 31 3686400 1500
28832377 Gleb_Dubosarskii A July 24, 2017, 2:49 p.m. OK MS C++ TESTS 52 31 4096000 1500
25906333 TonySnark A March 29, 2017, 4:33 p.m. OK MS C++ TESTS 52 31 4915200 1500
25901876 SiotaNagisa A March 29, 2017, 4:16 p.m. OK MS C++ TESTS 52 31 4915200 1500
57593672 vjudge2 A July 23, 2019, 1:09 p.m. OK MS C++ TESTS 52 46 1228800 1500
62054328 vjudge2 A Oct. 7, 2019, 11:31 a.m. OK MS C++ TESTS 52 46 1638400 1500
68851996 vjudge1 A Jan. 15, 2020, 9:17 a.m. OK MS C++ 2017 TESTS 52 46 1638400 1500
57961078 CtrlAlt A July 29, 2019, 10:29 p.m. OK MS C++ 2017 TESTS 52 62 1638400 1500
68849631 youneselarjouni A Jan. 15, 2020, 8:31 a.m. OK MS C++ 2017 TESTS 52 62 1638400 1500
68849819 youneselarjouni A Jan. 15, 2020, 8:35 a.m. OK MS C++ 2017 TESTS 52 62 1638400 1500
68849933 youneselarjouni A Jan. 15, 2020, 8:37 a.m. OK MS C++ 2017 TESTS 52 62 1638400 1500
68851890 vjudge1 A Jan. 15, 2020, 9:14 a.m. OK MS C++ 2017 TESTS 52 108 1433600 1500
52535058 kdy1023 A April 9, 2019, 3:12 p.m. OK MS C++ 2017 TESTS 52 109 409600 1500
68608197 vjudge3 A Jan. 11, 2020, 2:45 p.m. OK MS C++ 2017 TESTS 52 109 819200 1500
49763817 Gladius_Smerch A Feb. 11, 2019, 10:34 a.m. OK MS C++ 2017 TESTS 52 109 1228800 1500
52375279 MaeCheon A April 6, 2019, 7:59 a.m. OK MS C++ 2017 TESTS 52 109 1638400 1500
34218333 fortmax120 A Jan. 16, 2018, 10:01 a.m. OK PyPy 2 TESTS 52 139 30105600 1500
57742942 raj1307 A July 25, 2019, 12:02 p.m. OK PyPy 2 TESTS 52 171 11366400 1500
58837315 romil797 A Aug. 14, 2019, 10:05 p.m. OK PyPy 2 TESTS 52 186 8294400 1500
28825892 sambit25 A July 24, 2017, 1:47 p.m. OK PyPy 2 TESTS 52 186 39219200 1500
30233383 iit2014101 A Sept. 9, 2017, 8:04 p.m. OK PyPy 2 TESTS 52 202 15872000 1500
25929571 Trunks A March 29, 2017, 6:54 p.m. OK PyPy 2 TESTS 52 202 32665600 1500
32962488 abhigyank A Dec. 6, 2017, 5:50 a.m. OK PyPy 2 TESTS 52 202 38604800 1500
43279759 soumyasarkar1998 A Sept. 23, 2018, 4:13 a.m. OK PyPy 2 TESTS 52 265 8499200 1500
48441456 xumouyi A Jan. 16, 2019, 3:58 a.m. OK PyPy 3 TESTS 52 218 16793600 1500
47541745 H4Wk3ye A Dec. 27, 2018, 7:30 a.m. OK PyPy 3 TESTS 52 233 14028800 1500
47677122 yellowflash A Dec. 29, 2018, 9:51 a.m. OK PyPy 3 TESTS 52 233 16998400 1500
65247629 Mohamed_Ayman A Nov. 17, 2019, 10:59 a.m. OK PyPy 3 TESTS 52 249 12083200 1500
64063633 SarveshDubey A Nov. 2, 2019, 4:56 a.m. OK PyPy 3 TESTS 52 249 14540800 1500
63963321 rishus23 A Nov. 1, 2019, 6:11 a.m. OK PyPy 3 TESTS 52 264 13926400 1500
43428444 TRS A Sept. 25, 2018, 10:15 p.m. OK PyPy 3 TESTS 52 265 16793600 1500
65468519 uddeshya.singh A Nov. 21, 2019, 7:19 a.m. OK PyPy 3 TESTS 52 280 17203200 1500
26762025 adityavikram A April 30, 2017, 6:33 a.m. OK PyPy 3 TESTS 52 280 37683200 1500
63248514 UTMoonlight A Oct. 23, 2019, 3:19 p.m. OK PyPy 3 TESTS 52 296 13824000 1500
25905291 nwi A March 29, 2017, 4:29 p.m. OK Python 2 TESTS 52 171 10547200 1500
25959977 i_love_emilia_clarke A March 30, 2017, 5:31 p.m. OK Python 2 TESTS 52 218 10547200 1500
25929525 Onesh0t A March 29, 2017, 6:52 p.m. OK Python 2 TESTS 52 234 12902400 1500
27876986 vaibhav28 A June 18, 2017, 5:20 a.m. OK Python 2 TESTS 52 249 9011200 1500
30233377 iit2014101 A Sept. 9, 2017, 8:03 p.m. OK Python 2 TESTS 52 264 9113600 1500
33199911 ytz123 A Dec. 13, 2017, 2:12 a.m. OK Python 2 TESTS 52 265 10444800 1500
25955417 xhae A March 30, 2017, 2:22 p.m. OK Python 2 TESTS 52 265 10547200 1500
25939564 giongto35 A March 30, 2017, 3:28 a.m. OK Python 2 TESTS 52 265 10956800 1500
32879180 Hahahahahahahhahaha A Dec. 2, 2017, 4:36 p.m. OK Python 2 TESTS 52 265 14028800 1500
25941867 nealzane A March 30, 2017, 5:47 a.m. OK Python 2 TESTS 52 296 10547200 1500
27557708 juxuny A June 4, 2017, 7:21 a.m. OK Python 3 TESTS 52 233 9728000 1500
40818743 orailly A July 26, 2018, 9:11 p.m. OK Python 3 TESTS 52 234 9113600 1500
55589692 iamssk A June 15, 2019, 11:37 a.m. OK Python 3 TESTS 52 249 9216000 1500
26037808 blueset A March 31, 2017, 10:36 p.m. OK Python 3 TESTS 52 264 16486400 1500
56766029 chaudhary_19 A July 9, 2019, 6:22 p.m. OK Python 3 TESTS 52 280 9932800 1500
26204906 merolish A April 7, 2017, 10:03 p.m. OK Python 3 TESTS 52 280 14336000 1500
26905926 jPerlin A May 6, 2017, 4:28 p.m. OK Python 3 TESTS 52 296 9216000 1500
43557384 spellstaker A Sept. 29, 2018, 6:59 a.m. OK Python 3 TESTS 52 311 8806400 1500
47486861 Silky_Littleraisin A Dec. 25, 2018, 9:19 a.m. OK Python 3 TESTS 52 311 8908800 1500
52195002 MaxKaz A April 1, 2019, 4:36 p.m. OK Python 3 TESTS 52 311 9216000 1500
26596609 phirasit A April 23, 2017, 6:35 a.m. OK Ruby TESTS 52 421 61132800 1500
25901499 kobae964 A March 29, 2017, 4:14 p.m. OK Rust TESTS 52 108 108134400 1500

remove filters

Back to search problems