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
( 947 ) E Battle Lemmings PROGRAMMING brute force dp geometry

B"A lighthouse keeper Peter commands an army of n battle lemmings. He ordered his army to stand in a line and numbered the lemmings from 1 to n from left to right. Some of the lemmings hold shields. Each lemming cannot hold more than one shield. The more protected Peter's army is, the better. To calculate the protection of the army, he finds the number of protected pairs of lemmings, that is such pairs that both lemmings in the pair don't hold a shield, but there is a lemming with a shield between them. Now it's time to prepare for defence and increase the protection of the army. To do this, Peter can give orders. He chooses a lemming with a shield and gives him one of the two orders: In one second Peter can give exactly one order. It's not clear how much time Peter has before the defence. So he decided to determine the maximal value of army protection for each k from 0 to frac{n(n-1)}2 , if he gives no more that k orders. Help Peter to calculate it! First line contains a single integer n ( 1 <= n <= 80 ), the number of lemmings in Peter's army. Second line contains n integers a_i ( 0 <= a_i <= 1 ). If a_i = 1 , then the i -th lemming has a shield, otherwise a_i = 0 . Print frac{n(n-1)}2 + 1 numbers, the greatest possible protection after no more than 0, 1, ... , frac{n(n-1)}2 orders. Consider the first example. The protection is initially equal to zero, because for each pair of lemmings without shields there is no lemmings with shield. In one second Peter can order the first lemming give his shield to the right neighbor. In this case, the protection is two, as there are two protected pairs of lemmings, (1, 3) and (1, 4) . In two seconds Peter can act in the following way. First, he orders the fifth lemming to give a shield to the left neighbor. Then, he orders the first lemming to give a shield to the right neighbor. In this case Peter has three"...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93737615 Gassa E Sept. 24, 2020, 11:08 p.m. OK D TESTS 97 109 123904000
93737560 Gassa E Sept. 24, 2020, 11:06 p.m. OK D TESTS 97 109 123904000
93716440 Gassa E Sept. 24, 2020, 4:31 p.m. OK D TESTS 97 109 123904000
93738131 Gassa E Sept. 24, 2020, 11:35 p.m. OK D TESTS 97 124 123904000
93738238 Gassa E Sept. 24, 2020, 11:41 p.m. OK D TESTS 97 982 123904000
93730003 xsc E Sept. 24, 2020, 7:36 p.m. OK GNU C++11 TESTS 97 77 98611200
93751875 18380120126 E Sept. 25, 2020, 5:27 a.m. OK GNU C++11 TESTS 97 93 84172800
93745413 dysyn1314 E Sept. 25, 2020, 3:22 a.m. OK GNU C++11 TESTS 97 109 185446400
93746387 dysyn1314 E Sept. 25, 2020, 3:41 a.m. OK GNU C++11 TESTS 97 124 91648000
93742407 dysyn1314 E Sept. 25, 2020, 2:09 a.m. OK GNU C++11 TESTS 97 139 91648000
93738226 dysyn1314 E Sept. 24, 2020, 11:40 p.m. OK GNU C++11 TESTS 97 139 91648000
93746327 DestinHistoire E Sept. 25, 2020, 3:40 a.m. OK GNU C++11 TESTS 97 139 200806400
93739944 huangzhen E Sept. 25, 2020, 12:53 a.m. OK GNU C++11 TESTS 97 140 84172800
93753153 legend_life E Sept. 25, 2020, 5:47 a.m. OK GNU C++11 TESTS 97 140 209305600
93741446 jhknmj E Sept. 25, 2020, 1:42 a.m. OK GNU C++11 TESTS 97 155 240332800
93743736 Quang E Sept. 25, 2020, 2:44 a.m. OK GNU C++14 TESTS 97 77 10137600
93743676 Quang E Sept. 25, 2020, 2:42 a.m. OK GNU C++14 TESTS 97 78 10137600
93736969 shouryap E Sept. 24, 2020, 10:39 p.m. OK GNU C++14 TESTS 97 93 172544000
93747494 vandoor E Sept. 25, 2020, 4:05 a.m. OK GNU C++14 TESTS 97 124 209510400
93723459 qxforever E Sept. 24, 2020, 6:17 p.m. OK GNU C++14 TESTS 97 140 90828800
93711756 xb0nS E Sept. 24, 2020, 4:18 p.m. OK GNU C++14 TESTS 97 140 103628800
93750113 jairadheyshyam E Sept. 25, 2020, 4:57 a.m. OK GNU C++14 TESTS 97 140 232448000
93743710 WiwiHo E Sept. 25, 2020, 2:43 a.m. OK GNU C++14 TESTS 97 171 4403200
93723015 Devil E Sept. 24, 2020, 6:14 p.m. OK GNU C++14 TESTS 97 186 4608000
93713953 dlalswp25 E Sept. 24, 2020, 4:24 p.m. OK GNU C++14 TESTS 97 202 113868800
93752896 AlexFetisov E Sept. 25, 2020, 5:42 a.m. OK GNU C++17 TESTS 97 62 23244800
93711692 David_Garcia E Sept. 24, 2020, 4:18 p.m. OK GNU C++17 TESTS 97 62 214118400
93737117 tejas_919 E Sept. 24, 2020, 10:45 p.m. OK GNU C++17 TESTS 97 77 172544000
93722066 Giver E Sept. 24, 2020, 6:08 p.m. OK GNU C++17 TESTS 97 77 232652800
93715432 m.eghbaly E Sept. 24, 2020, 4:28 p.m. OK GNU C++17 TESTS 97 78 4403200
93721440 TeaPot E Sept. 24, 2020, 6:05 p.m. OK GNU C++17 TESTS 97 93 2048000
93711608 TeaPot E Sept. 24, 2020, 4:18 p.m. OK GNU C++17 TESTS 97 93 2048000
93730048 rainboy E Sept. 24, 2020, 7:37 p.m. OK GNU C++17 TESTS 97 108 2048000
93734474 Vladik E Sept. 24, 2020, 9:10 p.m. OK GNU C++17 TESTS 97 109 90624000
93737090 tejas_919 E Sept. 24, 2020, 10:44 p.m. OK GNU C++17 TESTS 97 109 172544000
93713978 risujiroh E Sept. 24, 2020, 4:24 p.m. OK GNU C++17 (64) TESTS 97 46 819200
93746851 inszva E Sept. 25, 2020, 3:51 a.m. OK GNU C++17 (64) TESTS 97 62 11264000
93726183 neal E Sept. 24, 2020, 6:44 p.m. OK GNU C++17 (64) TESTS 97 62 43212800
93746955 inszva E Sept. 25, 2020, 3:53 a.m. OK GNU C++17 (64) TESTS 97 77 11264000
93726406 neal E Sept. 24, 2020, 6:47 p.m. OK GNU C++17 (64) TESTS 97 77 43212800
93725354 neal E Sept. 24, 2020, 6:35 p.m. OK GNU C++17 (64) TESTS 97 77 43212800
93745461 compute E Sept. 25, 2020, 3:22 a.m. OK GNU C++17 (64) TESTS 97 77 91648000
93729983 xsc E Sept. 24, 2020, 7:36 p.m. OK GNU C++17 (64) TESTS 97 77 98611200
93729514 xsc E Sept. 24, 2020, 7:29 p.m. OK GNU C++17 (64) TESTS 97 77 98611200
93725942 neal E Sept. 24, 2020, 6:41 p.m. OK GNU C++17 (64) TESTS 97 78 43212800
93712884 insert_cool_handle E Sept. 24, 2020, 4:21 p.m. OK Java 11 TESTS 97 1200 147353600
93732919 Dukkha E Sept. 24, 2020, 8:32 p.m. OK Java 11 TESTS 97 1216 0
93737238 polyakoff E Sept. 24, 2020, 10:50 p.m. OK Java 8 TESTS 97 1465 17817600
93752658 WZYYN E Sept. 25, 2020, 5:39 a.m. OK PyPy 3 TESTS 97 560 14438400
93729387 Chipe1 E Sept. 24, 2020, 7:27 p.m. OK Rust TESTS 97 78 8192000
93730885 Chipe1 E Sept. 24, 2020, 7:52 p.m. OK Rust TESTS 97 93 8192000
93742349 sansen E Sept. 25, 2020, 2:08 a.m. OK Rust TESTS 97 982 177459200
93754216 sansen E Sept. 25, 2020, 6:02 a.m. OK Rust TESTS 97 1170 5939200

remove filters

Back to search problems