Codeforces Round 719 (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
1520 Codeforces Round 719 (Div. 3) FINISHED False 7200 117127511 May 5, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22309 ) E Arranging The Sheep PROGRAMMING dp greedy math

B'You are playing the game "Arranging The Sheep". The goal of this game is to make the sheep line up. The level in the game is described by a string of length n , consisting of the characters '. ' (empty space) and '* ' (sheep). In one move, you can move any sheep one square to the left or one square to the right, if the corresponding square exists and is empty. The game ends as soon as the sheep are lined up, that is, there should be no empty cells between any sheep. For example, if n=6 and the level is described by the string "**.*..", then the following game scenario is possible: For a given level, determine the minimum number of moves you need to make to complete the level. The first line contains one integer t ( 1 <= t <= 10^4 ). Then t test cases follow. The first line of each test case contains one integer n ( 1 <= n <= 10^6 ). The second line of each test case contains a string of length n , consisting of the characters '. ' (empty space) and '* ' (sheep) -- the description of the level. It is guaranteed that the sum of n over all test cases does not exceed 10^6 . For each test case output the minimum number of moves you need to make to complete the level. '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
115365562 Tommy0103 E May 6, 2021, 1:13 a.m. OK GNU C++11 TESTS 9 30 28774400
115382502 maoyifan E May 6, 2021, 5:47 a.m. OK GNU C++11 TESTS 9 31 4915200
115379709 hammerL E May 6, 2021, 5:18 a.m. OK GNU C++11 TESTS 9 31 4915200
115369094 pushpush111 E May 6, 2021, 2:40 a.m. OK GNU C++11 TESTS 9 31 4915200
115370839 Cleanblue E May 6, 2021, 3:11 a.m. OK GNU C++11 TESTS 9 31 9523200
115369990 syyyl E May 6, 2021, 2:56 a.m. OK GNU C++11 TESTS 9 31 11161600
115346816 k_saluja E May 5, 2021, 6:41 p.m. OK GNU C++11 TESTS 7 31 11264000
115344935 eiff E May 5, 2021, 6:23 p.m. OK GNU C++11 TESTS 7 31 11264000
115370663 ZJH111111 E May 6, 2021, 3:08 a.m. OK GNU C++11 TESTS 9 31 12902400
115369439 ihaveaworld. E May 6, 2021, 2:47 a.m. OK GNU C++11 TESTS 9 31 20889600
115350379 __Grisha__ E May 5, 2021, 7:22 p.m. OK GNU C++14 TESTS 7 30 5836800
115349875 Sahil_1509 E May 5, 2021, 7:16 p.m. OK GNU C++14 TESTS 7 30 17408000
115360123 karunesh13 E May 5, 2021, 10:23 p.m. OK GNU C++14 TESTS 9 31 5836800
115351086 divyevilking E May 5, 2021, 7:32 p.m. OK GNU C++14 TESTS 7 31 5836800
115379071 Eternal_S E May 6, 2021, 5:10 a.m. OK GNU C++14 TESTS 9 31 8806400
115376135 st1vdy E May 6, 2021, 4:33 a.m. OK GNU C++14 TESTS 9 31 11059200
115373669 Vishnu799 E May 6, 2021, 3:55 a.m. OK GNU C++14 TESTS 9 31 11059200
115368694 Rpsushil E May 6, 2021, 2:31 a.m. OK GNU C++14 TESTS 9 31 11059200
115362997 Kdimo E May 5, 2021, 11:52 p.m. OK GNU C++14 TESTS 9 31 11059200
115354509 Kousei_Arima E May 5, 2021, 8:21 p.m. OK GNU C++14 TESTS 7 31 11059200

remove filters

Back to search problems