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
B'Physicist Woll likes to play one relaxing game in between his search of the theory of everything. Game interface consists of a rectangular n xe2 x80 x89 xc3 x97 xe2 x80 x89m playing field and a dashboard. Initially some cells of the playing field are filled while others are empty. Dashboard contains images of all various connected (we mean connectivity by side) figures of 2, 3, 4 and 5 cells, with all their rotations and reflections. Player can copy any figure from the dashboard and place it anywhere at the still empty cells of the playing field. Of course any figure can be used as many times as needed. Woll 's aim is to fill the whole field in such a way that there are no empty cells left, and also... just have some fun. Every initially empty cell should be filled with exactly one cell of some figure. Every figure should be entirely inside the board. In the picture black cells stand for initially filled cells of the field, and one-colour regions represent the figures. First line contains integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000) -- the height and the width of the field correspondingly. Next n lines contain m symbols each. They represent the field in a natural way: j-th character of the i-th line is "#" if the corresponding cell is filled, and "." if it is empty. If there is no chance to win the game output the only number "-1" (without the quotes). Otherwise output any filling of the field by the figures in the following format: each figure should be represented by some digit and figures that touch each other by side should be represented by distinct digits. Every initially filled cell should be represented by "#". In the third sample, there is no way to fill a cell with no empty neighbours. In the forth sample, Woll does not have to fill anything, so we should output the field from the input.'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
483628 |
Nikolai |
B |
June 8, 2011, 9:49 p.m. |
OK |
Delphi |
TESTS |
90 |
130 |
23347200 |
|
2100 |
467658 |
tourist |
B |
May 22, 2011, 5:46 p.m. |
OK |
Delphi |
TESTS |
90 |
250 |
232857600 |
|
2100 |
469950 |
laiguokun |
B |
May 25, 2011, 3:30 p.m. |
OK |
Delphi |
TESTS |
90 |
270 |
10854400 |
|
2100 |
1979249 |
giongto35 |
B |
Aug. 6, 2012, 3:34 a.m. |
OK |
FPC |
TESTS |
90 |
170 |
25292800 |
|
2100 |
21643639 |
s34vv1nd |
B |
Oct. 21, 2016, 2:05 p.m. |
OK |
FPC |
TESTS |
90 |
187 |
129433600 |
|
2100 |
877004 |
coolinging |
B |
Nov. 18, 2011, 8:08 a.m. |
OK |
FPC |
TESTS |
90 |
190 |
19046400 |
|
2100 |
467530 |
Sereja |
B |
May 22, 2011, 5:32 p.m. |
OK |
FPC |
TESTS |
90 |
200 |
11980800 |
|
2100 |
467402 |
Sereja |
B |
May 22, 2011, 5:06 p.m. |
OK |
FPC |
TESTS |
90 |
200 |
11980800 |
|
2100 |
546591 |
vlad107 |
B |
July 15, 2011, 9:23 a.m. |
OK |
FPC |
TESTS |
90 |
250 |
28569600 |
|
2100 |
496719 |
scottai1 |
B |
June 18, 2011, 3:41 a.m. |
OK |
GNU C |
TESTS |
90 |
60 |
2355200 |
|
2100 |
466483 |
LayCurse |
B |
May 22, 2011, 3:34 p.m. |
OK |
GNU C |
TESTS |
90 |
90 |
2764800 |
|
2100 |
14194051 |
130705009 |
B |
Nov. 11, 2015, 8:24 a.m. |
OK |
GNU C++ |
TESTS |
90 |
31 |
1024000 |
|
2100 |
11270071 |
Amr_Hassan |
B |
May 25, 2015, 8:18 p.m. |
OK |
GNU C++ |
TESTS |
90 |
31 |
1024000 |
|
2100 |
3723769 |
marspeople |
B |
May 15, 2013, 1:53 p.m. |
OK |
GNU C++ |
TESTS |
90 |
31 |
1024000 |
|
2100 |
17871764 |
vjudge4 |
B |
May 12, 2016, 7:51 a.m. |
OK |
GNU C++ |
TESTS |
90 |
31 |
3276800 |
|
2100 |
40992685 |
ReaLNero1 |
B |
July 31, 2018, 1:29 a.m. |
OK |
GNU C++ |
TESTS |
90 |
46 |
1024000 |
|
2100 |
17871767 |
hnuRoshan |
B |
May 12, 2016, 7:51 a.m. |
OK |
GNU C++ |
TESTS |
90 |
46 |
3276800 |
|
2100 |
3555775 |
hehaodele |
B |
April 17, 2013, 10:27 a.m. |
OK |
GNU C++ |
TESTS |
90 |
46 |
6144000 |
|
2100 |
474018 |
ojdaemon |
B |
June 1, 2011, 2:09 p.m. |
OK |
GNU C++ |
TESTS |
90 |
50 |
2355200 |
|
2100 |
473386 |
ojdaemon |
B |
May 31, 2011, 12:29 p.m. |
OK |
GNU C++ |
TESTS |
90 |
50 |
2355200 |
|
2100 |
473384 |
ojdaemon |
B |
May 31, 2011, 12:21 p.m. |
OK |
GNU C++ |
TESTS |
90 |
50 |
2355200 |
|
2100 |
467241 |
DDDDDDDDDDDDDDDDDDDDDDDD |
B |
May 22, 2011, 4:55 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
50 |
2457600 |
|
2100 |
467158 |
Archon.JK |
B |
May 22, 2011, 4:48 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
360 |
20787200 |
|
2100 |
9338398 |
skrydg |
B |
Jan. 1, 2015, 11:43 a.m. |
OK |
GNU C++0x |
TESTS |
90 |
467 |
122368000 |
|
2100 |
466925 |
2222 |
B |
May 22, 2011, 4:19 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
610 |
45772800 |
|
2100 |
10248462 |
FizzyDavid |
B |
March 12, 2015, 2:38 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
670 |
178380800 |
|
2100 |
614476 |
Archon.JK |
B |
Aug. 18, 2011, 3:22 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
780 |
20787200 |
|
2100 |
3636472 |
LovelyPenguin |
B |
April 26, 2013, 2:45 p.m. |
OK |
GNU C++0x |
TESTS |
90 |
1125 |
18432000 |
|
2100 |
26364533 |
Chapecoense |
B |
April 14, 2017, 6:35 p.m. |
OK |
GNU C11 |
TESTS |
90 |
61 |
3379200 |
|
2100 |
16829797 |
freebsdx |
B |
March 20, 2016, 1:52 a.m. |
OK |
GNU C++11 |
TESTS |
90 |
31 |
3276800 |
|
2100 |
17069310 |
freebsdx |
B |
March 31, 2016, 8:14 a.m. |
OK |
GNU C++11 |
TESTS |
90 |
31 |
3276800 |
|
2100 |
27937352 |
Minology |
B |
June 21, 2017, 5:03 a.m. |
OK |
GNU C++11 |
TESTS |
90 |
31 |
3379200 |
|
2100 |
48456200 |
vjudge3 |
B |
Jan. 16, 2019, 12:45 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
46 |
1024000 |
|
2100 |
57905185 |
lopare |
B |
July 28, 2019, 5:20 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
46 |
1024000 |
|
2100 |
58343771 |
stoyan_malinin |
B |
Aug. 5, 2019, 2:10 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
61 |
14950400 |
|
2100 |
66972068 |
_ShadowSong |
B |
Dec. 15, 2019, 1:30 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
109 |
29491200 |
|
2100 |
27672895 |
423555290 |
B |
June 8, 2017, 2 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
202 |
45568000 |
|
2100 |
12987744 |
M.Mahdi |
B |
Sept. 13, 2015, 4:28 p.m. |
OK |
GNU C++11 |
TESTS |
90 |
390 |
48230400 |
|
2100 |
41265298 |
jebouin |
B |
Aug. 6, 2018, 6:42 a.m. |
OK |
GNU C++11 |
TESTS |
90 |
421 |
27750400 |
|
2100 |
59623996 |
NothingReallyMattersToMe |
B |
Aug. 28, 2019, 3:12 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
93 |
33792000 |
|
2100 |
63854093 |
_no0B |
B |
Oct. 30, 2019, 4:42 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
171 |
50585600 |
|
2100 |
56812149 |
Dasha_Gnedko |
B |
July 10, 2019, 4:50 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
218 |
37580800 |
|
2100 |
23620260 |
Ali.Pi |
B |
Jan. 7, 2017, 8:54 a.m. |
OK |
GNU C++14 |
TESTS |
90 |
249 |
2867200 |
|
2100 |
49746499 |
vjudge2 |
B |
Feb. 10, 2019, 10:04 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
311 |
46796800 |
|
2100 |
58865307 |
Stepavly |
B |
Aug. 15, 2019, 1:09 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
311 |
58982400 |
|
2100 |
49746485 |
Fischer |
B |
Feb. 10, 2019, 10:03 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
327 |
46796800 |
|
2100 |
28689963 |
SakurakoujiRuna |
B |
July 19, 2017, 8:19 a.m. |
OK |
GNU C++14 |
TESTS |
90 |
342 |
60723200 |
|
2100 |
58865263 |
Stepavly |
B |
Aug. 15, 2019, 1:08 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
514 |
58982400 |
|
2100 |
37888236 |
Cmise |
B |
May 4, 2018, 5:01 p.m. |
OK |
GNU C++14 |
TESTS |
90 |
608 |
223744000 |
|
2100 |
39642697 |
ruo |
B |
June 25, 2018, 8:06 a.m. |
OK |
GNU C++17 |
TESTS |
90 |
46 |
1024000 |
|
2100 |
49288217 |
.I. |
B |
Jan. 31, 2019, 6:25 p.m. |
OK |
GNU C++17 |
TESTS |
90 |
62 |
11673600 |
|
2100 |
58539330 |
BigPolandBro |
B |
Aug. 10, 2019, 1:24 p.m. |
OK |
GNU C++17 |
TESTS |
90 |
124 |
80588800 |
|
2100 |
58865314 |
Stepavly |
B |
Aug. 15, 2019, 1:09 p.m. |
OK |
GNU C++17 |
TESTS |
90 |
311 |
59084800 |
|
2100 |
61659449 |
ivan100sic |
B |
Oct. 1, 2019, 4:37 p.m. |
OK |
GNU C++17 |
TESTS |
90 |
405 |
113561600 |
|
2100 |
64276232 |
dorijanlendvaj |
B |
Nov. 4, 2019, 9:37 p.m. |
OK |
GNU C++17 |
TESTS |
90 |
888 |
9216000 |
|
2100 |
43403001 |
out111 |
B |
Sept. 25, 2018, 9:56 a.m. |
OK |
GNU C++17 |
TESTS |
90 |
998 |
203878400 |
|
2100 |
468228 |
SergeyLazarev |
B |
May 23, 2011, 8:13 a.m. |
OK |
Java 6 |
TESTS |
90 |
160 |
35430400 |
|
2100 |
467884 |
caustique |
B |
May 22, 2011, 7:48 p.m. |
OK |
Java 6 |
TESTS |
90 |
190 |
35430400 |
|
2100 |
6829042 |
ralonso |
B |
June 6, 2014, 9:54 p.m. |
OK |
Java 6 |
TESTS |
90 |
202 |
307200 |
|
2100 |
6829052 |
ralonso |
B |
June 6, 2014, 10:01 p.m. |
OK |
Java 6 |
TESTS |
90 |
218 |
307200 |
|
2100 |
466615 |
ktuan |
B |
May 22, 2011, 3:46 p.m. |
OK |
Java 6 |
TESTS |
90 |
310 |
35532800 |
|
2100 |
467669 |
S.Yesipenko |
B |
May 22, 2011, 5:49 p.m. |
OK |
Java 6 |
TESTS |
90 |
310 |
89292800 |
|
2100 |
466632 |
cerealguy |
B |
May 22, 2011, 3:48 p.m. |
OK |
Java 6 |
TESTS |
90 |
340 |
39321600 |
|
2100 |
467829 |
zibada |
B |
May 22, 2011, 7:03 p.m. |
OK |
Java 6 |
TESTS |
90 |
340 |
92057600 |
|
2100 |
466935 |
SpookyCookie |
B |
May 22, 2011, 4:21 p.m. |
OK |
Java 6 |
TESTS |
90 |
450 |
35532800 |
|
2100 |
467854 |
uwi |
B |
May 22, 2011, 7:17 p.m. |
OK |
Java 6 |
TESTS |
90 |
580 |
86425600 |
|
2100 |
8127242 |
Nero |
B |
Oct. 7, 2014, 7:02 a.m. |
OK |
Java 7 |
TESTS |
90 |
280 |
8396800 |
|
2100 |
15143883 |
HappyNewYearMike |
B |
Dec. 31, 2015, 11:49 p.m. |
OK |
Java 7 |
TESTS |
90 |
311 |
8089600 |
|
2100 |
17546056 |
mikcorer |
B |
April 27, 2016, 7:45 p.m. |
OK |
Java 8 |
TESTS |
90 |
343 |
27238400 |
|
2100 |
9211106 |
AlexFetisov |
B |
Dec. 20, 2014, 9:49 p.m. |
OK |
Java 8 |
TESTS |
90 |
358 |
0 |
|
2100 |
468117 |
tanzaku |
B |
May 23, 2011, 3:13 a.m. |
OK |
Mono C# |
TESTS |
90 |
700 |
9113600 |
|
2100 |
466739 |
Oleg |
B |
May 22, 2011, 3:58 p.m. |
OK |
MS C++ |
TESTS |
90 |
50 |
2355200 |
|
2100 |
466788 |
shindannin |
B |
May 22, 2011, 4:04 p.m. |
OK |
MS C++ |
TESTS |
90 |
60 |
2457600 |
|
2100 |
467876 |
Slevin |
B |
May 22, 2011, 7:41 p.m. |
OK |
MS C++ |
TESTS |
90 |
80 |
2662400 |
|
2100 |
523993 |
emppu |
B |
July 1, 2011, 6:38 a.m. |
OK |
MS C++ |
TESTS |
90 |
90 |
11468800 |
|
2100 |
467541 |
Olja |
B |
May 22, 2011, 5:33 p.m. |
OK |
MS C++ |
TESTS |
90 |
110 |
2662400 |
|
2100 |
3614965 |
XilinX |
B |
April 24, 2013, 5:13 a.m. |
OK |
MS C++ |
TESTS |
90 |
171 |
43315200 |
|
2100 |
466768 |
Erop |
B |
May 22, 2011, 4:01 p.m. |
OK |
MS C++ |
TESTS |
90 |
190 |
7987200 |
|
2100 |
467026 |
Chaker |
B |
May 22, 2011, 4:33 p.m. |
OK |
MS C++ |
TESTS |
90 |
200 |
6451200 |
|
2100 |
466698 |
cgy4ever |
B |
May 22, 2011, 3:54 p.m. |
OK |
MS C++ |
TESTS |
90 |
220 |
7475200 |
|
2100 |
467596 |
Philip_PV |
B |
May 22, 2011, 5:39 p.m. |
OK |
MS C++ |
TESTS |
90 |
230 |
17408000 |
|
2100 |
58536567 |
Spiritum |
B |
Aug. 10, 2019, 12:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
90 |
717 |
4915200 |
|
2100 |
15914776 |
not_bot_but_POT |
B |
Feb. 9, 2016, 1:52 p.m. |
OK |
Python 2 |
TESTS |
90 |
639 |
5120000 |
|
2100 |
35892018 |
______k______ |
B |
March 3, 2018, 3:21 p.m. |
OK |
Python 2 |
TESTS |
90 |
639 |
9625600 |
|
2100 |
35898532 |
______u______ |
B |
March 3, 2018, 6:17 p.m. |
OK |
Python 2 |
TESTS |
90 |
654 |
9625600 |
|
2100 |
35898088 |
_____k_____ |
B |
March 3, 2018, 6:15 p.m. |
OK |
Python 2 |
TESTS |
90 |
654 |
9625600 |
|
2100 |
35897795 |
______n______ |
B |
March 3, 2018, 6:05 p.m. |
OK |
Python 2 |
TESTS |
90 |
654 |
9625600 |
|
2100 |
35897647 |
_____i_____ |
B |
March 3, 2018, 6 p.m. |
OK |
Python 2 |
TESTS |
90 |
654 |
9625600 |
|
2100 |
35892026 |
______h______ |
B |
March 3, 2018, 3:21 p.m. |
OK |
Python 2 |
TESTS |
90 |
654 |
9625600 |
|
2100 |
56017010 |
sorry_im_smurfing |
B |
June 24, 2019, 10:13 p.m. |
OK |
Python 2 |
TESTS |
90 |
701 |
5017600 |
|
2100 |
42133533 |
Mk_Python_v1 |
B |
Aug. 26, 2018, 8:51 p.m. |
OK |
Python 2 |
TESTS |
90 |
763 |
5120000 |
|
2100 |
468724 |
-dp- |
B |
May 23, 2011, 7:24 p.m. |
OK |
Python 2 |
TESTS |
90 |
780 |
7475200 |
|
2100 |
remove filters
Back to search problems