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.
Problems
Sagheer is working at a kindergarten. There are n children and m different toys. These children use well-defined protocols for playing with the toys: Each child has a lovely set of toys that he loves to play with. He requests the toys one after another at distinct moments of time. A child starts playing if and only if he is granted all the toys in his lovely set. If a child starts playing, then sooner or later he gives the toys back. No child keeps the toys forever. Children request toys at distinct moments of time. No two children request a toy at the same time. If a child is granted a toy, he never gives it back until he finishes playing with his lovely set. If a child is not granted a toy, he waits until he is granted this toy. He can't request another toy while waiting. If two children are waiting for the same toy, then the child who requested it first will take the toy first. Children don't like to play with each other. That's why they never share toys. When a child requests a toy, then granting the toy to this child depends on whether the toy is free or not. If the toy is free, Sagheer will give it to the child. Otherwise, the child has to wait for it and can't request another toy. Children are smart and can detect if they have to wait forever before they get the toys they want. In such case they start crying. In other words, a crying set is a set of children in which each child is waiting for a toy that is kept by another child in the set. Now, we have reached a scenario where all the children made all the requests for their lovely sets, except for one child x that still has one last request for his lovely set. Some children are playing while others are waiting for a toy, but no child is crying, and no one has yet finished playing. If the child x is currently waiting for some toy, he makes his last request just after getting that toy. Otherwise, he makes the request right away. When child x will make his last request, how many children will start cr |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
27704838 |
Talon_F |
D |
June 10, 2017, 11:08 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
5939200 |
|
2700 |
|
27561683 |
AtlantisLove |
D |
June 4, 2017, 11:17 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
5939200 |
|
2700 |
|
27581840 |
vjudge4 |
D |
June 5, 2017, 11:34 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
6553600 |
|
2700 |
|
27534240 |
jiyutian |
D |
June 3, 2017, 2:34 a.m. |
OK |
GNU C++ |
TESTS |
57 |
46 |
6553600 |
|
2700 |
|
27573177 |
AkaneSasu |
D |
June 4, 2017, 11:57 p.m. |
OK |
GNU C++ |
TESTS |
57 |
46 |
8192000 |
|
2700 |
|
27614058 |
xzyxzy |
D |
June 6, 2017, 12:51 p.m. |
OK |
GNU C++ |
TESTS |
57 |
46 |
14438400 |
|
2700 |
|
31241252 |
DoveChild |
D |
Oct. 12, 2017, 12:54 p.m. |
OK |
GNU C++ |
TESTS |
57 |
46 |
51302400 |
|
2700 |
|
30177783 |
vjudge3 |
D |
Sept. 7, 2017, 9:45 a.m. |
OK |
GNU C++ |
TESTS |
57 |
77 |
7168000 |
|
2700 |
|
27524474 |
cyand1317 |
D |
June 2, 2017, 1:23 p.m. |
OK |
GNU C++ |
TESTS |
57 |
78 |
5939200 |
|
2700 |
|
27518376 |
livingshade |
D |
June 2, 2017, 8 a.m. |
OK |
GNU C++ |
TESTS |
57 |
78 |
6451200 |
|
2700 |
|
27581818 |
Mr.Mo |
D |
June 5, 2017, 11:32 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
31 |
6553600 |
|
2700 |
|
27497781 |
Honoka |
D |
June 1, 2017, 3:30 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
31 |
10035200 |
|
2700 |
|
27769515 |
ctlchild |
D |
June 14, 2017, 7:26 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
46 |
6451200 |
|
2700 |
|
27621148 |
fanache99 |
D |
June 6, 2017, 8:12 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
46 |
7782400 |
|
2700 |
|
27575471 |
1102301 |
D |
June 5, 2017, 4:26 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
46 |
9216000 |
|
2700 |
|
27514431 |
sengxian |
D |
June 2, 2017, 3:45 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
46 |
10035200 |
|
2700 |
|
40980825 |
ReaLNero1 |
D |
July 30, 2018, 5:43 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
61 |
10035200 |
|
2700 |
|
29912728 |
deep_learning |
D |
Aug. 30, 2017, 9:06 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
77 |
6758400 |
|
2700 |
|
27523543 |
O_Monitor |
D |
June 2, 2017, 12:32 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
77 |
6758400 |
|
2700 |
|
32737695 |
D_XF |
D |
Nov. 28, 2017, 12:47 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
77 |
8908800 |
|
2700 |
|
29716935 |
Egor.Lifar |
D |
Aug. 23, 2017, 8:26 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
31 |
7884800 |
|
2700 |
|
28115036 |
up-and-down |
D |
June 28, 2017, noon |
OK |
GNU C++14 |
TESTS |
57 |
46 |
9932800 |
|
2700 |
|
27524610 |
zoomswk |
D |
June 2, 2017, 1:30 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
78 |
10137600 |
|
2700 |
|
27571984 |
krijgertje |
D |
June 4, 2017, 10:11 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
6041600 |
|
2700 |
|
29121145 |
sz1231 |
D |
Aug. 2, 2017, 7:32 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
7475200 |
|
2700 |
|
27516811 |
sylxjtu |
D |
June 2, 2017, 6:28 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
8192000 |
|
2700 |
|
27525666 |
duke007 |
D |
June 2, 2017, 2:20 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
9113600 |
|
2700 |
|
27539557 |
jstztzy |
D |
June 3, 2017, 8:42 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
9420800 |
|
2700 |
|
27516964 |
akshit.lite |
D |
June 2, 2017, 6:36 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
9728000 |
|
2700 |
|
27631376 |
I_Love_Umirzhanova_Amina |
D |
June 7, 2017, 11:25 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
93 |
10240000 |
|
2700 |
|
41591293 |
vjudge1 |
D |
Aug. 14, 2018, 2:10 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
109 |
7782400 |
|
2700 |
|
64554002 |
hjk1030 |
D |
Nov. 9, 2019, 2:11 a.m. |
OK |
GNU C++17 |
TESTS |
57 |
109 |
8192000 |
|
2700 |
|
55868754 |
aryanc403 |
D |
June 21, 2019, 1:34 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
124 |
7884800 |
|
2700 |
|
65037948 |
karemo |
D |
Nov. 15, 2019, 12:22 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
124 |
8192000 |
|
2700 |
|
55830845 |
vjudge1 |
D |
June 20, 2019, 1:04 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
124 |
9728000 |
|
2700 |
|
55830767 |
MASTERASSASSIN |
D |
June 20, 2019, 1:02 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
124 |
9728000 |
|
2700 |
|
64054280 |
Umi |
D |
Nov. 2, 2019, 12:11 a.m. |
OK |
GNU C++17 |
TESTS |
57 |
140 |
10137600 |
|
2700 |
|
53194319 |
YazanZk |
D |
April 23, 2019, 2:26 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
389 |
9728000 |
|
2700 |
|
46661783 |
_Samir |
D |
Dec. 5, 2018, 7:57 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
390 |
9728000 |
|
2700 |
|
46661950 |
_Samir |
D |
Dec. 5, 2018, 8:06 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
436 |
17920000 |
|
2700 |
|
27539650 |
uwi |
D |
June 3, 2017, 8:48 a.m. |
OK |
Java 8 |
TESTS |
57 |
171 |
4812800 |
|
2700 |
|
27509687 |
olya-chuchuk |
D |
June 1, 2017, 7:40 p.m. |
OK |
Java 8 |
TESTS |
57 |
202 |
18841600 |
|
2700 |
|
61115862 |
ZeyadKhattab |
D |
Sept. 23, 2019, 12:51 p.m. |
OK |
Java 8 |
TESTS |
57 |
233 |
23449600 |
|
2700 |
|
61115955 |
ZeyadKhattab |
D |
Sept. 23, 2019, 12:52 p.m. |
OK |
Java 8 |
TESTS |
57 |
233 |
26726400 |
|
2700 |
|
27768976 |
donli |
D |
June 14, 2017, 6:48 a.m. |
OK |
Java 8 |
TESTS |
57 |
234 |
4300800 |
|
2700 |
|
27630076 |
Rats004 |
D |
June 7, 2017, 10:10 a.m. |
OK |
Java 8 |
TESTS |
57 |
248 |
25190400 |
|
2700 |
|
27769136 |
donli |
D |
June 14, 2017, 7:01 a.m. |
OK |
Java 8 |
TESTS |
57 |
249 |
4300800 |
|
2700 |
|
27694986 |
tri |
D |
June 9, 2017, 6:52 p.m. |
OK |
Java 8 |
TESTS |
57 |
311 |
65433600 |
|
2700 |
|
28727046 |
wolfib |
D |
July 20, 2017, 2:03 p.m. |
OK |
Java 8 |
TESTS |
57 |
311 |
83763200 |
|
2700 |
|
27522325 |
olya-chuchuk |
D |
June 2, 2017, 11:29 a.m. |
OK |
Java 8 |
TESTS |
57 |
764 |
28364800 |
|
2700 |
|
27502036 |
mircea85 |
D |
June 1, 2017, 4:01 p.m. |
OK |
MS C# |
TESTS |
57 |
202 |
16384000 |
|
2700 |
|
27580540 |
sas |
D |
June 5, 2017, 10:24 a.m. |
OK |
PyPy 3 |
TESTS |
57 |
841 |
36454400 |
|
2700 |
remove filters
Back to search problems