Codeforces Round 780 (Div. 3)

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
1660 Codeforces Round 780 (Div. 3) FINISHED False 8100 83085899 March 31, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8748 ) D Maximum Product Strikes Back PROGRAMMING binary search implementation math

B'You are given an array a consisting of n integers. For each i ( 1 <= i <= n ) the following inequality is true: -2 <= a_i <= 2 . You can remove any number (possibly 0 ) of elements from the beginning of the array and any number (possibly 0 ) of elements from the end of the array. You are allowed to delete the whole array. You need to answer the question: how many elements should be removed from the beginning of the array, and how many elements should be removed from the end of the array, so that the result will be an array whose product (multiplication) of elements is maximal. If there is more than one way to get an array with the maximum product of elements on it, you are allowed to output any of them. The product of elements of an empty array (array of length 0 ) should be assumed to be 1 . The first line of input data contains an integer t ( 1 <= t <= 10^4 ) --the number of test cases in the test. Then the descriptions of the input test cases follow. The first line of each test case description contains an integer n ( 1 <= n <= 2 cdot 10^5 ) --the length of array a . The next line contains n integers a_1, a_2, ... , a_n ( |a_i| <= 2 ) -- elements of array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output two non-negative numbers x and y ( 0 <= x + y <= n ) -- such that the product (multiplication) of the array numbers, after removing x elements from the beginning and y elements from the end, is maximal. If there is more than one way to get the maximal product, it is allowed to output any of them. Consider the product of numbers on empty array to be 1 . In the first case, the maximal value of the product is 2 . Thus, we can either delete the first three elements (obtain array [2] ), or the last two and one first element (a'...

Tutorials

Codeforces Round #780 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
151586260 ruban D March 31, 2022, 4:44 p.m. OK Delphi TESTS 18 46 99532800
151605844 NenadDapic D March 31, 2022, 7:50 p.m. OK FPC TESTS 22 62 1638400
151588143 iiJoe D March 31, 2022, 4:48 p.m. OK GNU C11 TESTS 18 93 16793600
151588559 tjn1234 D March 31, 2022, 4:48 p.m. OK GNU C++14 TESTS 18 31 819200
151624331 Suffocating D April 1, 2022, 4:16 a.m. OK GNU C++14 TESTS 27 31 2457600
151631609 jinqihao2023 D April 1, 2022, 6:03 a.m. OK GNU C++14 TESTS 27 31 3993600
151592081 bkd D March 31, 2022, 5:08 p.m. OK GNU C++14 TESTS 18 31 7987200
151617827 wlkx D April 1, 2022, 1:44 a.m. OK GNU C++14 TESTS 27 31 9625600
151589413 harshit567 D March 31, 2022, 4:51 p.m. OK GNU C++14 TESTS 18 46 0
151623138 JerryWangJunjie D April 1, 2022, 3:52 a.m. OK GNU C++14 TESTS 27 46 819200
151623120 JerryWangJunjie D April 1, 2022, 3:52 a.m. OK GNU C++14 TESTS 27 46 819200
151620456 ZXYAC D April 1, 2022, 2:50 a.m. OK GNU C++14 TESTS 27 46 819200
151620134 jarven D April 1, 2022, 2:43 a.m. OK GNU C++14 TESTS 27 46 819200
151620606 prodipdatta7 D April 1, 2022, 2:54 a.m. OK GNU C++17 TESTS 27 31 819200
151617045 Ximenana D April 1, 2022, 1:20 a.m. OK GNU C++17 TESTS 27 31 819200
151589925 Ice_teapoy D March 31, 2022, 4:53 p.m. OK GNU C++17 TESTS 18 31 2355200
151585523 mikeeedanilov D March 31, 2022, 4:42 p.m. OK GNU C++17 TESTS 18 31 2355200
151621043 zrr12138 D April 1, 2022, 3:06 a.m. OK GNU C++17 TESTS 27 31 2457600
151618324 ccsu_Y_Y D April 1, 2022, 1:58 a.m. OK GNU C++17 TESTS 27 31 2457600
151593601 Well_Answer D March 31, 2022, 5:21 p.m. OK GNU C++17 TESTS 18 31 2457600
151586841 Chenfree D March 31, 2022, 4:45 p.m. OK GNU C++17 TESTS 18 31 2457600
151603384 over_thinkerr D March 31, 2022, 7:14 p.m. OK GNU C++17 TESTS 22 31 6144000
151627038 Dog_food_is_me D April 1, 2022, 4:59 a.m. OK GNU C++17 TESTS 27 31 13721600
151601826 AkshitDh D March 31, 2022, 6:53 p.m. OK GNU C++17 (64) TESTS 22 31 819200
151629079 atanughosh01 D April 1, 2022, 5:29 a.m. OK GNU C++17 (64) TESTS 27 31 819200
151622693 Rick_GT D April 1, 2022, 3:42 a.m. OK GNU C++17 (64) TESTS 27 31 819200
151585537 PHarr D March 31, 2022, 4:42 p.m. OK GNU C++17 (64) TESTS 18 31 819200
151583885 Bruteforcekid D March 31, 2022, 4:38 p.m. OK GNU C++17 (64) TESTS 18 31 1638400
151614692 codelegend D March 31, 2022, 11:52 p.m. OK GNU C++17 (64) TESTS 27 31 1638400
151593246 nevikw39 D March 31, 2022, 5:17 p.m. OK GNU C++17 (64) TESTS 18 31 1638400
151617021 moo. D April 1, 2022, 1:18 a.m. OK GNU C++17 (64) TESTS 27 31 2150400
151592315 vlad_1028 D March 31, 2022, 5:10 p.m. OK GNU C++17 (64) TESTS 18 31 2150400
151593035 xhdtlsid2 D March 31, 2022, 5:15 p.m. OK GNU C++17 (64) TESTS 18 31 2457600
151585298 xwb20021119 D March 31, 2022, 4:42 p.m. OK GNU C++20 (64) TESTS 18 31 819200
151589009 WTR2007 D March 31, 2022, 4:49 p.m. OK GNU C++20 (64) TESTS 18 31 819200
151619532 SCOR_PION D April 1, 2022, 2:30 a.m. OK GNU C++20 (64) TESTS 27 31 819200
151605890 dush1729 D March 31, 2022, 7:51 p.m. OK GNU C++20 (64) TESTS 22 31 819200
151598442 keshavgoel_186 D March 31, 2022, 6:12 p.m. OK GNU C++20 (64) TESTS 22 31 819200
151596358 rushitote D March 31, 2022, 5:49 p.m. OK GNU C++20 (64) TESTS 22 31 819200
151595271 NotANoob D March 31, 2022, 5:37 p.m. OK GNU C++20 (64) TESTS 22 31 819200
151598344 kuan525 D March 31, 2022, 6:11 p.m. OK GNU C++20 (64) TESTS 22 31 1024000
151624771 paekae D April 1, 2022, 4:25 a.m. OK GNU C++20 (64) TESTS 27 31 1024000
151597644 kuan525 D March 31, 2022, 6:04 p.m. OK GNU C++20 (64) TESTS 22 31 1126400
151596919 LXL D March 31, 2022, 5:55 p.m. OK Go TESTS 22 78 4300800
151622282 0x3F D April 1, 2022, 3:34 a.m. OK Go TESTS 27 93 1228800
151612727 ssvb D March 31, 2022, 10:17 p.m. OK Go TESTS 27 109 37171200
151629614 ssd_98 D April 1, 2022, 5:37 a.m. OK Java 11 TESTS 27 249 10956800
151626293 Wuya D April 1, 2022, 4:48 a.m. OK Java 11 TESTS 27 249 11161600
151588360 ujjwalbhan.ub D March 31, 2022, 4:48 p.m. OK Java 11 TESTS 18 265 2662400
151585243 qw_er__ty D March 31, 2022, 4:41 p.m. OK Java 11 TESTS 18 280 1945600
151595375 StaleBread D March 31, 2022, 5:38 p.m. OK Java 11 TESTS 22 280 16384000
151584300 sh3t4ru D March 31, 2022, 4:39 p.m. OK Java 11 TESTS 18 420 0
151590262 g0dzilla D March 31, 2022, 4:56 p.m. OK Java 11 TESTS 18 436 0
151623683 1364354238zxd D April 1, 2022, 4:03 a.m. OK Java 11 TESTS 27 436 3891200
151597370 Eslam_Ahmed D March 31, 2022, 6:01 p.m. OK Java 11 TESTS 22 592 2252800
151586413 1shak D March 31, 2022, 4:44 p.m. OK Java 8 TESTS 18 109 0
151605007 Omar_Mohammad D March 31, 2022, 7:37 p.m. OK Java 8 TESTS 22 124 0
151631099 g906360 D April 1, 2022, 5:56 a.m. OK Java 8 TESTS 27 124 0
151620819 Y_s_y_s D April 1, 2022, 3 a.m. OK Java 8 TESTS 27 124 0
151612066 ayafayed D March 31, 2022, 9:59 p.m. OK Java 8 TESTS 27 124 0
151606185 NatInTheHat D March 31, 2022, 7:55 p.m. OK Java 8 TESTS 22 124 307200
151589675 Omar_Mohammad D March 31, 2022, 4:52 p.m. OK Java 8 TESTS 18 140 0
151608510 kartikpapney D March 31, 2022, 8:36 p.m. OK Java 8 TESTS 22 140 0
151593908 harshitnsharma D March 31, 2022, 5:23 p.m. OK Java 8 TESTS 18 140 14131200
151618330 kareem3id D April 1, 2022, 1:58 a.m. OK Java 8 TESTS 27 170 6860800
151614722 cfcfs D March 31, 2022, 11:53 p.m. OK Kotlin 1.5 TESTS 27 343 10035200
151614647 cfcfs D March 31, 2022, 11:50 p.m. OK Kotlin 1.5 TESTS 27 358 11468800
151616342 AIdancer D April 1, 2022, 12:54 a.m. OK MS C++ 2017 TESTS 27 46 4812800
151593413 toraoh D March 31, 2022, 5:19 p.m. OK .NET Core C# TESTS 18 109 12288000
151586925 XYShaoKang D March 31, 2022, 4:45 p.m. OK Node.js TESTS 18 155 7475200
151587501 kagu D March 31, 2022, 4:46 p.m. OK PyPy 2 TESTS 18 234 11776000
151602080 1_2_3_4_5_9 D March 31, 2022, 6:57 p.m. OK PyPy 2 TESTS 22 265 14233600
151586447 lemiao12 D March 31, 2022, 4:44 p.m. OK PyPy 3 TESTS 18 233 13414400
151601836 grawlixes D March 31, 2022, 6:53 p.m. OK PyPy 3 TESTS 22 233 14643200
151590259 arpan.parikh D March 31, 2022, 4:55 p.m. OK PyPy 3 TESTS 18 311 14950400
151603906 sushmanth.dampur8780 D March 31, 2022, 7:21 p.m. OK PyPy 3 TESTS 22 374 19456000
151594722 legend.ary_as D March 31, 2022, 5:31 p.m. OK PyPy 3 TESTS 22 389 17408000
151602532 r_j_sangram D March 31, 2022, 7:02 p.m. OK PyPy 3 TESTS 22 467 22323200
151593715 Kuprik D March 31, 2022, 5:22 p.m. OK PyPy 3 TESTS 18 639 14336000
151609771 DaniilNemtsev D March 31, 2022, 9:01 p.m. OK PyPy 3 TESTS 27 795 14336000
151610297 stardust.skg D March 31, 2022, 9:14 p.m. OK PyPy 3 TESTS 27 1840 18739200
151619940 xabialonso14 D April 1, 2022, 2:39 a.m. OK PyPy 3-64 TESTS 27 249 22425600
151629645 stand_by D April 1, 2022, 5:37 a.m. OK PyPy 3-64 TESTS 27 296 26419200
151599964 skp_r D March 31, 2022, 6:29 p.m. OK PyPy 3-64 TESTS 22 311 22732800
151584682 hydthemoon D March 31, 2022, 4:40 p.m. OK PyPy 3-64 TESTS 18 311 27033600
151614626 kazamasmile D March 31, 2022, 11:49 p.m. OK PyPy 3-64 TESTS 27 326 22220800
151596083 Mashin_larner D March 31, 2022, 5:46 p.m. OK PyPy 3-64 TESTS 22 342 25497600
151629465 stand_by D April 1, 2022, 5:35 a.m. OK PyPy 3-64 TESTS 27 373 21708800
151586984 Skillful_Wanderer D March 31, 2022, 4:45 p.m. OK PyPy 3-64 TESTS 18 405 39014400
151588890 unknownSolver D March 31, 2022, 4:49 p.m. OK PyPy 3-64 TESTS 18 436 44748800
151608970 sPARTY D March 31, 2022, 8:45 p.m. OK PyPy 3-64 TESTS 25 467 27852800
151584302 lobanko D March 31, 2022, 4:39 p.m. OK Python 3 TESTS 18 295 10752000
151621021 pennymagic156 D April 1, 2022, 3:05 a.m. OK Python 3 TESTS 27 296 19763200
151612350 NewSaeed D March 31, 2022, 10:07 p.m. OK Python 3 TESTS 27 342 10854400
151623710 one_punch_man11 D April 1, 2022, 4:04 a.m. OK Python 3 TESTS 27 436 10752000
151583659 Evdokimovdimas D March 31, 2022, 4:37 p.m. OK Python 3 TESTS 18 545 20377600
151589154 TheStriker D March 31, 2022, 4:49 p.m. OK Python 3 TESTS 18 577 13516800
151587145 multi21 D March 31, 2022, 4:46 p.m. OK Python 3 TESTS 18 623 13209600
151588108 gesserit D March 31, 2022, 4:48 p.m. OK Python 3 TESTS 18 1934 10752000
151616461 Spheniscine D April 1, 2022, 12:58 a.m. OK Rust 2021 TESTS 27 30 307200
151608907 cwlo2f D March 31, 2022, 8:44 p.m. OK Rust 2021 TESTS 25 108 2457600
151611723 cwlo2f D March 31, 2022, 9:51 p.m. OK Rust 2021 TESTS 27 108 55091200
151611758 cwlo2f D March 31, 2022, 9:51 p.m. OK Rust 2021 TESTS 27 139 35840000

remove filters

Back to search problems