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 |
1170
|
Kotlin Heroes: Episode 1 |
FINISHED |
False |
9000 |
178385087 |
May 28, 2019, 2:35 p.m. |
Problems
B"Imagine that you are the CEO of a big old-fashioned company. Unlike any modern and progressive company (such as JetBrains), your company has a dress code. That's why you have already allocated a spacious room for your employees where they can change their clothes. Moreover, you've already purchased an m -compartment wardrobe, so the i -th employee can keep his/her belongings in the i -th cell (of course, all compartments have equal widths). The issue has occurred: the wardrobe has sliding doors! More specifically, the wardrobe has n doors (numbered from left to right) and the j -th door has width equal to a_j wardrobe's cells. The wardrobe has single rails so that no two doors can slide past each other. The problem is as follows: sometimes to open some cells you must close some other cells (since all doors are placed on the single track). For example, if you have a 4 -compartment wardrobe (i.e. m=4 ) with n=2 one-cell doors (i.e. a_1=a_2=1 ) and you need to open the 1 -st and the 3 -rd cells, you have to close the 2 -nd and the 4 -th cells. As CEO, you have a complete schedule for the next q days. Now you are wondering: is it possible that all employees who will come on the k -th day can access their cells simultaneously? The first line contains two integers n and m ( 1 <= n <= 2 cdot 10^5 , 1 <= m <= 4 cdot 10^5 ) -- the number of doors and compartments respectively. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= m , sum{a_i} <= m ) -- the corresponding widths of the doors. The third line contains a single integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of days you have to process. The next q lines describe schedule of each day. Each schedule is represented as an integer c_k followed by c_k integers w_1, w_2, ... , w_{c_k} ( 1 <= c_k <= 2 cdot 10^5 "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
54805944 |
sarthakmanna |
E |
May 29, 2019, 2:08 p.m. |
OK |
Kotlin |
TESTS |
62 |
186 |
0 |
|
|
54761762 |
drd93 |
E |
May 28, 2019, 4:01 p.m. |
OK |
Kotlin |
TESTS |
62 |
186 |
921600 |
|
|
55610786 |
ReaLNero1 |
E |
June 16, 2019, 5:35 a.m. |
OK |
Kotlin |
TESTS |
62 |
202 |
0 |
|
|
54757341 |
eatmore |
E |
May 28, 2019, 3:04 p.m. |
OK |
Kotlin |
TESTS |
62 |
217 |
3788800 |
|
|
54763768 |
evagl |
E |
May 28, 2019, 4:32 p.m. |
OK |
Kotlin |
TESTS |
62 |
265 |
3891200 |
|
|
54756860 |
Petr |
E |
May 28, 2019, 2:58 p.m. |
OK |
Kotlin |
TESTS |
62 |
280 |
3174400 |
|
|
54759690 |
NighTurs |
E |
May 28, 2019, 3:33 p.m. |
OK |
Kotlin |
TESTS |
62 |
280 |
4198400 |
|
|
54757978 |
300iq |
E |
May 28, 2019, 3:12 p.m. |
OK |
Kotlin |
TESTS |
62 |
280 |
4812800 |
|
|
54759099 |
xiaowuc1 |
E |
May 28, 2019, 3:26 p.m. |
OK |
Kotlin |
TESTS |
62 |
280 |
5529600 |
|
|
64667708 |
derrick20 |
E |
Nov. 11, 2019, 3:44 a.m. |
OK |
Kotlin |
TESTS |
62 |
311 |
4915200 |
|
|
remove filters
Back to search problems