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 |
---|---|---|---|---|---|---|
1070 | 2018-2019 ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 191800499 | Oct. 20, 2018, 8:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4955 ) | K | Video Posts | PROGRAMMING | implementation | 1200 |
B'Polycarp took n videos, the duration of the i -th video is a_i seconds. The videos are listed in the chronological order, i.e. the 1 -st video is the earliest, the 2 -nd video is the next, ..., the n -th video is the last. Now Polycarp wants to publish exactly k ( 1 <= k <= n ) posts in Instabram. Each video should be a part of a single post. The posts should preserve the chronological order, it means that the first post should contain one or more of the earliest videos, the second post should contain a block (one or more videos) going next and so on. In other words, if the number of videos in the j -th post is s_j then: Polycarp is a perfectionist, he wants the total duration of videos in each post to be the same. Help Polycarp to find such positive integer values s_1, s_2, ... , s_k that satisfy all the conditions above. The first line contains two integers n and k ( 1 <= k <= n <= 10^5 ). The next line contains n positive integer numbers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^4 ), where a_i is the duration of the i -th video. If solution exists, print "Yes" in the first line. Print k positive integers s_1, s_2, ... , s_k ( s_1+s_2+ ... +s_k=n ) in the second line. The total duration of videos in each post should be the same. It can be easily proven that the answer is unique (if it exists). If there is no solution, print a single line "No". '... |
Solution to problem M. Algoland and Berland of 2018-2019 ICPC, NEERC |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
44577602 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577449 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577421 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577353 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577297 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577264 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577256 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577255 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577246 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 | ||
44577214 | K | Oct. 20, 2018, 7:33 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 | 1200 |
Back to search problems