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
Little Masha loves arranging her toys into piles on the floor. And she also hates it when somebody touches her toys. One day Masha arranged all her n toys into several piles and then her elder brother Sasha came and gathered all the piles into one. Having seen it, Masha got very upset and started crying. Sasha still can't calm Masha down and mom is going to come home soon and punish Sasha for having made Masha crying. That's why he decides to restore the piles' arrangement. However, he doesn't remember at all the way the toys used to lie. Of course, Masha remembers it, but she can't talk yet and can only help Sasha by shouting happily when he arranges the toys in the way they used to lie. That means that Sasha will have to arrange the toys in every possible way until Masha recognizes the needed arrangement. The relative position of the piles and toys in every pile is irrelevant, that's why the two ways of arranging the toys are considered different if can be found two such toys that when arranged in the first way lie in one and the same pile and do not if arranged in the second way. Sasha is looking for the fastest way of trying all the ways because mom will come soon. With every action Sasha can take a toy from any pile and move it to any other pile (as a result a new pile may appear or the old one may disappear). Sasha wants to find the sequence of actions as a result of which all the pile arrangement variants will be tried exactly one time each. Help Sasha. As we remember, initially all the toys are located in one pile. The first line contains an integer n ( 1 ≤ n ≤ 10 ) — the number of toys. In the first line print the number of different variants of arrangement of toys into piles. Then print all the ways of arranging toys into piles in the order in which Sasha should try them (i.e. every next way must result from the previous one through the operation described in the statement). Every way should be printed in the following format. In every pile the t |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
184915 |
BLIZZARD GR1n map |
I |
Nov. 6, 2010, 8:57 p.m. |
OK |
Delphi |
TESTS |
10 |
140 |
103116800 |
|
2400 |
|
184910 |
BLIZZARD GR1n map |
I |
Nov. 6, 2010, 8:33 p.m. |
OK |
Delphi |
TESTS |
10 |
170 |
137113600 |
|
2400 |
|
40993440 |
ReaLNero1 |
I |
July 31, 2018, 1:58 a.m. |
OK |
Delphi |
TESTS |
10 |
248 |
102297600 |
|
2400 |
|
7885507 |
Vitaha |
I |
Sept. 20, 2014, 5:23 p.m. |
OK |
Delphi |
TESTS |
10 |
342 |
3686400 |
|
2400 |
|
4263889 |
ysyshtc |
I |
Aug. 11, 2013, 4:09 a.m. |
OK |
Delphi |
TESTS |
10 |
560 |
6041600 |
|
2400 |
|
4263803 |
footo |
I |
Aug. 11, 2013, 3:43 a.m. |
OK |
Delphi |
TESTS |
10 |
560 |
6041600 |
|
2400 |
|
182668 |
tourist |
I |
Nov. 6, 2010, 12:15 p.m. |
OK |
Delphi |
TESTS |
10 |
3450 |
120627200 |
|
2400 |
|
256211 |
agul |
I |
Jan. 21, 2011, 1:05 p.m. |
OK |
Delphi |
TESTS |
10 |
3480 |
120729600 |
|
2400 |
|
4264045 |
_gXX |
I |
Aug. 11, 2013, 5:13 a.m. |
OK |
FPC |
TESTS |
10 |
966 |
7475200 |
|
2400 |
|
4263801 |
footo |
I |
Aug. 11, 2013, 3:42 a.m. |
OK |
FPC |
TESTS |
10 |
966 |
7475200 |
|
2400 |
|
276744 |
scottai1 |
I |
Feb. 7, 2011, 1:42 p.m. |
OK |
GNU C |
TESTS |
10 |
230 |
1331200 |
|
2400 |
|
734457 |
gen nvilcins eduardische |
I |
Nov. 6, 2010, 2:23 p.m. |
OK |
GNU C |
TESTS |
10 |
330 |
1433600 |
|
2400 |
|
184399 |
dkirienko |
I |
Nov. 6, 2010, 3:27 p.m. |
OK |
GNU C++ |
TESTS |
10 |
140 |
7987200 |
|
2400 |
|
4266389 |
jackraft |
I |
Aug. 11, 2013, 2:33 p.m. |
OK |
GNU C++ |
TESTS |
10 |
156 |
10854400 |
|
2400 |
|
506018 |
vjudge3 |
I |
June 21, 2011, 8:09 a.m. |
OK |
GNU C++ |
TESTS |
10 |
200 |
1433600 |
|
2400 |
|
183803 |
Gassa naagi |
I |
Nov. 6, 2010, 2:03 p.m. |
OK |
GNU C++ |
TESTS |
10 |
220 |
1331200 |
|
2400 |
|
183703 |
Gassa naagi |
I |
Nov. 6, 2010, 1:48 p.m. |
OK |
GNU C++ |
TESTS |
10 |
230 |
1331200 |
|
2400 |
|
11273465 |
Amr_Hassan |
I |
May 26, 2015, 5:11 a.m. |
OK |
GNU C++ |
TESTS |
10 |
312 |
0 |
|
2400 |
|
4263758 |
_gXX |
I |
Aug. 11, 2013, 3:24 a.m. |
OK |
GNU C++ |
TESTS |
10 |
312 |
10444800 |
|
2400 |
|
565200 |
xubenben |
I |
July 25, 2011, 11:42 a.m. |
OK |
GNU C++ |
TESTS |
10 |
340 |
9932800 |
|
2400 |
|
404355 |
ArcOfDream |
I |
April 21, 2011, 7:55 a.m. |
OK |
GNU C++ |
TESTS |
10 |
360 |
7680000 |
|
2400 |
|
4138019 |
vjudge2 |
I |
July 23, 2013, 1:34 a.m. |
OK |
GNU C++ |
TESTS |
10 |
375 |
0 |
|
2400 |
|
7951439 |
M.Mahdi |
I |
Sept. 25, 2014, 9:59 p.m. |
OK |
GNU C++0x |
TESTS |
10 |
934 |
84377600 |
|
2400 |
|
7951437 |
M.Mahdi |
I |
Sept. 25, 2014, 9:59 p.m. |
OK |
GNU C++0x |
TESTS |
10 |
966 |
84377600 |
|
2400 |
|
2872704 |
Archon.JK |
I |
Jan. 4, 2013, 9:19 a.m. |
OK |
GNU C++0x |
TESTS |
10 |
1437 |
69734400 |
|
2400 |
|
15805893 |
Y-MP |
I |
Feb. 4, 2016, 6:21 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
374 |
0 |
|
2400 |
|
17083326 |
freebsdx |
I |
April 1, 2016, 1:20 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
404 |
7270400 |
|
2400 |
|
57907282 |
lopare |
I |
July 28, 2019, 6:11 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
498 |
6144000 |
|
2400 |
|
20326832 |
SssssssssssssbbbBBBB |
I |
Sept. 1, 2016, 4:54 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
530 |
6553600 |
|
2400 |
|
20326726 |
vjudge1 |
I |
Sept. 1, 2016, 4:50 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
622 |
6553600 |
|
2400 |
|
17086958 |
doubility |
I |
April 1, 2016, 8:38 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
716 |
17612800 |
|
2400 |
|
12000870 |
HellKitsune |
I |
July 10, 2015, 6:34 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
810 |
43622400 |
|
2400 |
|
17385895 |
2016 |
I |
April 19, 2016, 10:54 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
842 |
11980800 |
|
2400 |
|
54495822 |
WOSHIGEPACHONG2 |
I |
May 22, 2019, 5:40 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
1714 |
5427200 |
|
2400 |
|
44926700 |
irkstepanov |
I |
Oct. 26, 2018, 8:32 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
1744 |
5324800 |
|
2400 |
|
33041737 |
chinmay0906 |
I |
Dec. 9, 2017, 6:36 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
278 |
5120000 |
|
2400 |
|
33041804 |
chinmay0906 |
I |
Dec. 9, 2017, 6:40 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
280 |
5120000 |
|
2400 |
|
67982337 |
hpfdf |
I |
Dec. 30, 2019, 8 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
374 |
5017600 |
|
2400 |
|
23621755 |
Ali.Pi |
I |
Jan. 7, 2017, 10:27 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
498 |
7270400 |
|
2400 |
|
54587969 |
bhargav_0085 |
I |
May 25, 2019, 7:36 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
808 |
5427200 |
|
2400 |
|
51327776 |
kenimo |
I |
March 15, 2019, 10:45 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
404 |
9318400 |
|
2400 |
|
37856118 |
ruo |
I |
May 3, 2018, 7:45 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
436 |
12697600 |
|
2400 |
|
67598079 |
RNS_CUS |
I |
Dec. 25, 2019, 10:58 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
468 |
8806400 |
|
2400 |
|
59681268 |
DeadInsideOnTest993 |
I |
Aug. 29, 2019, 8:48 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
590 |
9318400 |
|
2400 |
|
56015578 |
sorry_im_smurfing |
I |
June 24, 2019, 8:54 p.m. |
OK |
Haskell |
TESTS |
10 |
810 |
23142400 |
|
2400 |
|
185340 |
KTR |
I |
Nov. 8, 2010, 9:33 a.m. |
OK |
Haskell |
TESTS |
10 |
950 |
25702400 |
|
2400 |
|
35873074 |
______u______ |
I |
March 3, 2018, 7:23 a.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35872961 |
______n______ |
I |
March 3, 2018, 7:21 a.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35872191 |
_____k_____ |
I |
March 3, 2018, 7:04 a.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35872187 |
_____i_____ |
I |
March 3, 2018, 7:04 a.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35863238 |
______k______ |
I |
March 2, 2018, 10:42 p.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35863218 |
______h______ |
I |
March 2, 2018, 10:42 p.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35862686 |
______i______ |
I |
March 2, 2018, 10:30 p.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
35861207 |
______M______ |
I |
March 2, 2018, 9:58 p.m. |
OK |
Haskell |
TESTS |
10 |
1184 |
76492800 |
|
2400 |
|
2319837 |
HuaNaaFC |
I |
Oct. 7, 2012, 7:07 p.m. |
OK |
Java 6 |
TESTS |
10 |
312 |
512000 |
|
2400 |
|
183622 |
KiRiN rofi uwi |
I |
Nov. 6, 2010, 1:37 p.m. |
OK |
Java 6 |
TESTS |
10 |
330 |
43315200 |
|
2400 |
|
6834437 |
indy256 |
I |
June 7, 2014, 10:44 p.m. |
OK |
Java 8 |
TESTS |
10 |
842 |
2662400 |
|
2400 |
|
1996892 |
Timur_Sitdikov |
I |
Aug. 10, 2012, 7:03 a.m. |
OK |
MS C++ |
TESTS |
10 |
410 |
1433600 |
|
2400 |
|
185856 |
IgorYevchynets |
I |
Dec. 6, 2010, 10:48 a.m. |
OK |
MS C++ |
TESTS |
10 |
550 |
9113600 |
|
2400 |
|
4128915 |
aa2985759 |
I |
July 21, 2013, 11:37 a.m. |
OK |
MS C++ |
TESTS |
10 |
718 |
4403200 |
|
2400 |
|
15141493 |
HappyNewYearMike |
I |
Dec. 31, 2015, 9:32 p.m. |
OK |
MS C++ |
TESTS |
10 |
996 |
27340800 |
|
2400 |
|
524525 |
kokopelli |
I |
July 1, 2011, 10:40 a.m. |
OK |
MS C++ |
TESTS |
10 |
1140 |
27955200 |
|
2400 |
|
183051 |
xhae ainu7 Astein domeng |
I |
Nov. 6, 2010, 12:45 p.m. |
OK |
MS C++ |
TESTS |
10 |
1310 |
46489600 |
|
2400 |
|
184587 |
Berestinsky |
I |
Nov. 6, 2010, 3:55 p.m. |
OK |
MS C++ |
TESTS |
10 |
1380 |
50483200 |
|
2400 |
|
19108490 |
DimonK |
I |
July 14, 2016, 1:18 p.m. |
OK |
MS C++ |
TESTS |
10 |
2714 |
15667200 |
|
2400 |
|
445761 |
Gassa |
I |
May 12, 2011, 2:14 p.m. |
OK |
Python 2 |
TESTS |
10 |
3130 |
15974400 |
|
2400 |
|
45947815 |
humberto.souza.1095152 |
I |
Nov. 19, 2018, 2:55 a.m. |
OK |
Python 3 |
TESTS |
10 |
4616 |
12390400 |
|
2400 |
remove filters
Back to search problems