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'You are given a 4x4 grid. You play a game -- there is a sequence of tiles, each of them is either 2x1 or 1x2. Your task is to consequently place all tiles from the given sequence in the grid. When tile is placed, each cell which is located in fully occupied row or column is deleted (cells are deleted at the same time independently). You can place tile in the grid at any position, the only condition is that tiles (and tile parts) should not overlap. Your goal is to proceed all given figures and avoid crossing at any time. The only line contains a string s consisting of zeroes and ones ( 1 <= |s| <= 1000 ). Zero describes vertical tile, one describes horizontal tile. Output |s| lines -- for each tile you should output two positive integers r,c , not exceeding 4 , representing numbers of smallest row and column intersecting with it. If there exist multiple solutions, print any of them. Following image illustrates the example after placing all three tiles: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
48726370 |
fluffyowl |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
D |
TESTS |
14 |
31 |
0 |
|
1400 |
48740564 |
Gassa |
A |
Jan. 22, 2019, 3:13 p.m. |
OK |
D |
TESTS |
14 |
31 |
0 |
|
1400 |
48734131 |
rainboy |
A |
Jan. 22, 2019, 2:56 p.m. |
OK |
GNU C11 |
TESTS |
14 |
30 |
0 |
|
1400 |
48727318 |
LJC00118 |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
0 |
|
1400 |
48727113 |
wcy1122 |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
0 |
|
1400 |
48735397 |
niu |
A |
Jan. 22, 2019, 2:59 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
0 |
|
1400 |
48732718 |
Khada_Jhin |
A |
Jan. 22, 2019, 2:52 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
0 |
|
1400 |
48730102 |
mukel |
A |
Jan. 22, 2019, 2:47 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
0 |
|
1400 |
48726676 |
gisp_zjz |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
15 |
512000 |
|
1400 |
48739539 |
sillysilly |
A |
Jan. 22, 2019, 3:10 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
30 |
0 |
|
1400 |
48730802 |
sharpener |
A |
Jan. 22, 2019, 2:48 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
30 |
0 |
|
1400 |
48729814 |
Mohammad_Yasser |
A |
Jan. 22, 2019, 2:46 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
30 |
0 |
|
1400 |
48743147 |
Ez3qwq |
A |
Jan. 22, 2019, 3:21 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
30 |
0 |
|
1400 |
48737921 |
sugarrr |
A |
Jan. 22, 2019, 3:05 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48733534 |
iaNTU |
A |
Jan. 22, 2019, 2:54 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48732506 |
sdnr1 |
A |
Jan. 22, 2019, 2:52 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48731131 |
OnionPringles |
A |
Jan. 22, 2019, 2:49 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48729314 |
Hasan0540 |
A |
Jan. 22, 2019, 2:46 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48729191 |
ankurdua15 |
A |
Jan. 22, 2019, 2:45 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48728966 |
Learner99 |
A |
Jan. 22, 2019, 2:45 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48728942 |
imathi |
A |
Jan. 22, 2019, 2:45 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48728864 |
danya.smelskiy |
A |
Jan. 22, 2019, 2:45 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48733891 |
imxian |
A |
Jan. 22, 2019, 2:55 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
15 |
0 |
|
1400 |
48734536 |
AIshutin |
A |
Jan. 22, 2019, 2:57 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
102400 |
|
1400 |
48726617 |
Lawali |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48731392 |
47th-draganov |
A |
Jan. 22, 2019, 2:50 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48729333 |
train_driver |
A |
Jan. 22, 2019, 2:46 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48727852 |
0101-1001 |
A |
Jan. 22, 2019, 2:43 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48727423 |
Juve45 |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48727368 |
Aleksandr2754 |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48727349 |
helThazar |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48726649 |
Stroustrup |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48726583 |
Slaaava |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
15 |
204800 |
|
1400 |
48727799 |
Kharouba |
A |
Jan. 22, 2019, 2:43 p.m. |
OK |
Java 8 |
TESTS |
14 |
108 |
0 |
|
1400 |
48727347 |
fnch |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
Java 8 |
TESTS |
14 |
109 |
0 |
|
1400 |
48725550 |
Harpae |
A |
Jan. 22, 2019, 2:39 p.m. |
OK |
Java 8 |
TESTS |
14 |
109 |
0 |
|
1400 |
48733434 |
AkshajK |
A |
Jan. 22, 2019, 2:54 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48731643 |
fetetriste |
A |
Jan. 22, 2019, 2:50 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48728511 |
Egor |
A |
Jan. 22, 2019, 2:44 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48728045 |
iakovlev.zakhar |
A |
Jan. 22, 2019, 2:43 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48727427 |
Musin |
A |
Jan. 22, 2019, 2:42 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48726280 |
Dukkha |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
Java 8 |
TESTS |
14 |
124 |
0 |
|
1400 |
48727637 |
alexyz |
A |
Jan. 22, 2019, 2:43 p.m. |
OK |
Java 8 |
TESTS |
14 |
139 |
0 |
|
1400 |
48726486 |
math957963 |
A |
Jan. 22, 2019, 2:41 p.m. |
OK |
MS C++ |
TESTS |
14 |
46 |
204800 |
|
1400 |
48729347 |
pajenegod |
A |
Jan. 22, 2019, 2:46 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
155 |
0 |
|
1400 |
48728186 |
Jonte_98 |
A |
Jan. 22, 2019, 2:43 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
155 |
0 |
|
1400 |
48728463 |
nwi |
A |
Jan. 22, 2019, 2:44 p.m. |
OK |
Python 2 |
TESTS |
14 |
171 |
0 |
|
1400 |
48725868 |
whatshisbucket |
A |
Jan. 22, 2019, 2:40 p.m. |
OK |
Python 3 |
TESTS |
14 |
124 |
409600 |
|
1400 |
48725876 |
bigbigbigcat111 |
A |
Jan. 22, 2019, 2:40 p.m. |
OK |
Python 3 |
TESTS |
14 |
124 |
614400 |
|
1400 |
remove filters
Back to search problems