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 |
925
|
VK Cup 2018 - Round 3 |
FINISHED |
False |
9000 |
206815499 |
April 29, 2018, 1:15 p.m. |
Problems
B"It's May in Flatland, and there are m days in this month. Despite the fact that May Holidays are canceled long time ago, employees of some software company still have a habit of taking short or long vacations in May. Of course, not all managers of the company like this. There are n employees in the company that form a tree-like structure of subordination: each employee has a unique integer id i between 1 and n , and each employee with id i (except the head manager whose id is 1) has exactly one direct manager with id p_i . The structure of subordination is not cyclic, i.e. if we start moving from any employee to his direct manager, then we will eventually reach the head manager. We define that an employee u is a subordinate of an employee v , if v is a direct manager of u , or the direct manager of u is a subordinate of v . Let s_i be the number of subordinates the i -th employee has (for example, s_1 = n - 1 , because all employees except himself are subordinates of the head manager). Each employee i has a bearing limit of t_i , which is an integer between 0 and s_i . It denotes the maximum number of the subordinates of the i -th employee being on vacation at the same moment that he can bear. If at some moment strictly more than t_i subordinates of the i -th employee are on vacation, and the i -th employee himself is not on a vacation, he becomes displeased. In each of the m days of May exactly one event of the following two types happens: either one employee leaves on a vacation at the beginning of the day, or one employee returns from a vacation in the beginning of the day. You know the sequence of events in the following m days. Your task is to compute for each of the m days the number of displeased employees on that day. The first line contains two integers n and m ( 2 <= q n, m <= q 10^5$$"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
38082990 |
Desico |
E |
May 10, 2018, 1:38 a.m. |
OK |
GNU C++ |
TESTS |
40 |
4476 |
240025600 |
|
2900 |
59853210 |
foreverlasting |
E |
Sept. 1, 2019, 12:27 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
311 |
223641600 |
|
2900 |
59853646 |
Owen_codeisking |
E |
Sept. 1, 2019, 12:38 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
452 |
180838400 |
|
2900 |
61295900 |
ysy20021208 |
E |
Sept. 26, 2019, 1 a.m. |
OK |
GNU C++11 |
TESTS |
40 |
498 |
169369600 |
|
2900 |
66141437 |
mrsrz |
E |
Dec. 1, 2019, 2:35 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
561 |
29184000 |
|
2900 |
59853618 |
luogu_bot4 |
E |
Sept. 1, 2019, 12:37 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
561 |
215347200 |
|
2900 |
66141529 |
mrsrz |
E |
Dec. 1, 2019, 2:37 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
576 |
29081600 |
|
2900 |
66813582 |
ILoLy |
E |
Dec. 14, 2019, 4:30 a.m. |
OK |
GNU C++11 |
TESTS |
40 |
623 |
176128000 |
|
2900 |
66141315 |
mrsrz |
E |
Dec. 1, 2019, 2:31 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
842 |
29081600 |
|
2900 |
38252051 |
yfzcsc |
E |
May 14, 2018, 11:53 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
1060 |
30720000 |
|
2900 |
38252042 |
yfzcsc |
E |
May 14, 2018, 11:51 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
1263 |
21094400 |
|
2900 |
40978323 |
ReaLNero1 |
E |
July 30, 2018, 4:35 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
234 |
14848000 |
|
2900 |
68963018 |
cxr_o__o_cxr |
E |
Jan. 17, 2020, 2:47 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
514 |
175308800 |
|
2900 |
41465270 |
DEMOPON |
E |
Aug. 11, 2018, 10:38 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
607 |
216678400 |
|
2900 |
38722331 |
4l5n3 |
E |
May 29, 2018, 3:14 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
607 |
216678400 |
|
2900 |
38722251 |
4l5n3 |
E |
May 29, 2018, 3:11 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
623 |
259788800 |
|
2900 |
38722146 |
4l5n3 |
E |
May 29, 2018, 3:05 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
623 |
259788800 |
|
2900 |
38722355 |
4l5n3 |
E |
May 29, 2018, 3:15 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
624 |
206950400 |
|
2900 |
38722223 |
4l5n3 |
E |
May 29, 2018, 3:09 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
624 |
259788800 |
|
2900 |
38722303 |
4l5n3 |
E |
May 29, 2018, 3:13 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
654 |
216678400 |
|
2900 |
41464122 |
DEMOPON |
E |
Aug. 11, 2018, 10:01 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
655 |
216678400 |
|
2900 |
68930997 |
jiangly |
E |
Jan. 16, 2020, 11:19 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
483 |
17408000 |
|
2900 |
38993606 |
cjnwq |
E |
June 6, 2018, 11:50 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
514 |
19353600 |
|
2900 |
37722841 |
V--o_o--V LHiC |
E |
April 29, 2018, 2:56 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
514 |
22732800 |
|
2900 |
68930521 |
jiangly |
E |
Jan. 16, 2020, 11:13 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
576 |
17408000 |
|
2900 |
68923688 |
jiangly |
E |
Jan. 16, 2020, 9:55 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
638 |
17408000 |
|
2900 |
39007958 |
cjnwq |
E |
June 7, 2018, 3:37 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
654 |
26931200 |
|
2900 |
68923645 |
jiangly |
E |
Jan. 16, 2020, 9:54 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
685 |
17408000 |
|
2900 |
38996078 |
cjnwq |
E |
June 6, 2018, 1:32 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
685 |
26931200 |
|
2900 |
68923564 |
jiangly |
E |
Jan. 16, 2020, 9:53 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
686 |
17408000 |
|
2900 |
39040151 |
cjnwq |
E |
June 8, 2018, 8:37 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
686 |
23449600 |
|
2900 |
remove filters
Back to search problems