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'Berland crossword is a puzzle that is solved on a square grid with n rows and n columns. Initially all the cells are white. To solve the puzzle one has to color some cells on the border of the grid black in such a way that: Note that you can color zero cells black and leave every cell white. Your task is to check if there exists a solution to the given puzzle. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of testcases. Then the descriptions of t testcases follow. The only line of each testcase contains 5 integers n, U, R, D, L ( 2 <= n <= 100 ; 0 <= U, R, D, L <= n ). For each testcase print "YES" if the solution exists and "NO" otherwise. You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer). Here are possible solutions to testcases 1 , 2 and 4 : '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
108969274 |
1473439561pp |
B |
March 3, 2021, 2:55 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
7 |
46 |
0 |
|
|
108951361 |
rexleung |
B |
March 2, 2021, 5:44 p.m. |
OK |
GNU C++11 |
TESTS |
4 |
0 |
0 |
|
|
108935974 |
zwu2019015035 |
B |
March 2, 2021, 4:26 p.m. |
OK |
GNU C++11 |
TESTS |
4 |
0 |
0 |
|
|
108967296 |
bkifhr9 |
B |
March 3, 2021, 1:41 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
0 |
0 |
|
|
108975299 |
pranshukas |
B |
March 3, 2021, 5:21 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108974466 |
R4ptor |
B |
March 3, 2021, 5:06 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108973994 |
sharmamohit |
B |
March 3, 2021, 4:57 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108974423 |
hkumar0132 |
B |
March 3, 2021, 5:05 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108976197 |
quantumbinary |
B |
March 3, 2021, 5:36 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108975717 |
JennyQ |
B |
March 3, 2021, 5:28 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108975647 |
pranshukas |
B |
March 3, 2021, 5:27 a.m. |
OK |
GNU C++11 |
TESTS |
7 |
15 |
0 |
|
|
108940238 |
Saman. |
B |
March 2, 2021, 4:36 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
108952487 |
Pankaj_Kumar1 |
B |
March 2, 2021, 5:59 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
108937241 |
TimeWarp101 |
B |
March 2, 2021, 4:29 p.m. |
OK |
GNU C++14 |
TESTS |
4 |
0 |
0 |
|
|
108974847 |
aryan_madaan |
B |
March 3, 2021, 5:13 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108977766 |
Aaste123 |
B |
March 3, 2021, 6:03 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108977717 |
varanshu |
B |
March 3, 2021, 6:02 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108977228 |
satvik76 |
B |
March 3, 2021, 5:54 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108977221 |
Aaj_me_fodega |
B |
March 3, 2021, 5:54 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108977159 |
code_hello |
B |
March 3, 2021, 5:52 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108975178 |
i_am_chitti |
B |
March 3, 2021, 5:19 a.m. |
OK |
GNU C++14 |
TESTS |
7 |
15 |
0 |
|
|
108939812 |
saratcsss |
B |
March 2, 2021, 4:35 p.m. |
OK |
.NET Core C# |
TESTS |
4 |
93 |
204800 |
|
|
remove filters
Back to search problems