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"Allen dreams of one day owning a enormous fleet of electric cars, the car of the future! He knows that this will give him a big status boost. As Allen is planning out all of the different types of cars he will own and how he will arrange them, he realizes that he has a problem. Allen's future parking lot can be represented as a rectangle with 4 rows and n ( n <= 50 ) columns of rectangular spaces, each of which can contain at most one car at any time. He imagines having k ( k <= 2n ) cars in the grid, and all the cars are initially in the second and third rows. Each of the cars also has a different designated parking space in the first or fourth row. Allen has to put the cars into corresponding parking places. However, since Allen would never entrust his cars to anyone else, only one car can be moved at a time. He can drive a car from a space in any of the four cardinal directions to a neighboring empty space. Furthermore, Allen can only move one of his cars into a space on the first or fourth rows if it is the car's designated parking space. Allen knows he will be a very busy man, and will only have time to move cars at most 20000 times before he realizes that moving cars is not worth his time. Help Allen determine if he should bother parking his cars or leave it to someone less important. The first line of the input contains two space-separated integers n and k ( 1 <= n <= 50 , 1 <= k <= 2n ), representing the number of columns and the number of cars, respectively. The next four lines will contain n integers each between 0 and k inclusive, representing the initial state of the parking lot. The rows are numbered 1 to 4 from top to bottom and the columns are numbered 1 to n from left to right. In the first and last line, an integer 1 <= x <= k represents a parking spot assigned to car x (you can only move this car to this place), while the i"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
69505798 |
hos.lyric |
A |
Jan. 25, 2020, 8:32 a.m. |
OK |
D |
TESTS |
57 |
31 |
4198400 |
|
2100 |
39617971 |
MissMyDearest |
A |
June 24, 2018, 5:15 p.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
102400 |
|
2100 |
39985234 |
KrewZh |
A |
July 5, 2018, 1:10 p.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
102400 |
|
2100 |
42355825 |
dyxx |
A |
Sept. 2, 2018, 8:38 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
204800 |
|
2100 |
39816623 |
HbFS- |
A |
July 1, 2018, 8:57 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
39635391 |
zhouzhendong |
A |
June 25, 2018, 1:37 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
39619797 |
fpdqwq |
A |
June 24, 2018, 5:27 p.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
40779273 |
luogu_bot5 |
A |
July 26, 2018, 12:53 p.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
40542222 |
luogu_bot5 |
A |
July 19, 2018, 9:18 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
40542190 |
zhou2003 |
A |
July 19, 2018, 9:17 a.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
307200 |
|
2100 |
39909648 |
anhtuan19981998 |
A |
July 3, 2018, 3:19 p.m. |
OK |
GNU C++ |
TESTS |
57 |
31 |
409600 |
|
2100 |
39637925 |
sparkuggz |
A |
June 25, 2018, 4:32 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
307200 |
|
2100 |
39637628 |
orz_liuwei |
A |
June 25, 2018, 4:13 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
307200 |
|
2100 |
39663107 |
Starlit |
A |
June 26, 2018, 2:11 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39653071 |
krijgertje |
A |
June 25, 2018, 3 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39645411 |
RDDCCD |
A |
June 25, 2018, 9:51 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39641916 |
aka.Sohieb |
A |
June 25, 2018, 7:37 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39622414 |
just_soso |
A |
June 24, 2018, 5:46 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39639992 |
IohcEjnim |
A |
June 25, 2018, 6:17 a.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
512000 |
|
2100 |
39632772 |
zdw1999 |
A |
June 24, 2018, 9:38 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
1228800 |
|
2100 |
39623133 |
Mikaeel |
A |
June 24, 2018, 5:51 p.m. |
OK |
GNU C++11 |
TESTS |
57 |
30 |
2048000 |
|
2100 |
39649270 |
Antygenius |
A |
June 25, 2018, 12:24 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
15 |
409600 |
|
2100 |
39633580 |
antguz |
A |
June 24, 2018, 10:37 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
15 |
409600 |
|
2100 |
39612659 |
LHiC |
A |
June 24, 2018, 4:48 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
15 |
409600 |
|
2100 |
39633074 |
Rzepa |
A |
June 24, 2018, 9:57 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
15 |
14950400 |
|
2100 |
39693476 |
Avny |
A |
June 27, 2018, 7 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
204800 |
|
2100 |
39652820 |
astral17 |
A |
June 25, 2018, 2:49 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
307200 |
|
2100 |
60849635 |
Berted |
A |
Sept. 19, 2019, 1:39 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39694447 |
samjia2000 |
A |
June 27, 2018, 7:39 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39687444 |
AprilGrimoire |
A |
June 26, 2018, 11:14 p.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39642848 |
Toxel |
A |
June 25, 2018, 8:13 a.m. |
OK |
GNU C++14 |
TESTS |
57 |
30 |
409600 |
|
2100 |
66004834 |
ffao |
A |
Nov. 29, 2019, 8:54 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
15 |
409600 |
|
2100 |
60489645 |
roll_no_1 |
A |
Sept. 13, 2019, 2 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
15 |
716800 |
|
2100 |
39671700 |
paradox |
A |
June 26, 2018, 9:42 a.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
204800 |
|
2100 |
66366864 |
gravito12345 |
A |
Dec. 5, 2019, 7:47 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
307200 |
|
2100 |
39663341 |
rebecacalazans |
A |
June 26, 2018, 2:28 a.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
307200 |
|
2100 |
40749044 |
hermano95 _Gucci_ |
A |
July 25, 2018, 4:29 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
409600 |
|
2100 |
66974601 |
dioji |
A |
Dec. 15, 2019, 2:14 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
409600 |
|
2100 |
66890235 |
iulianrotaru |
A |
Dec. 14, 2019, 8:07 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
409600 |
|
2100 |
41948378 |
as277575 |
A |
Aug. 21, 2018, 8:59 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
409600 |
|
2100 |
39657071 |
Omar_Morsi |
A |
June 25, 2018, 5:57 p.m. |
OK |
GNU C++17 |
TESTS |
57 |
30 |
409600 |
|
2100 |
64537054 |
ijxjdjd |
A |
Nov. 8, 2019, 5:19 p.m. |
OK |
Java 8 |
TESTS |
57 |
124 |
0 |
|
2100 |
69291757 |
yaoct |
A |
Jan. 22, 2020, 10:32 a.m. |
OK |
Java 8 |
TESTS |
57 |
124 |
0 |
|
2100 |
39741842 |
kessido |
A |
June 28, 2018, 11:55 a.m. |
OK |
Java 8 |
TESTS |
57 |
139 |
0 |
|
2100 |
39848793 |
parthp7995 |
A |
July 1, 2018, 6:55 p.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
39741583 |
kessido |
A |
June 28, 2018, 11:44 a.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
39682209 |
ayushchaurasia2879 |
A |
June 26, 2018, 5:23 p.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
39625069 |
aabdelzaher |
A |
June 24, 2018, 6:07 p.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
39617154 |
uwi |
A |
June 24, 2018, 5:10 p.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
42440106 |
KulikAlex |
A |
Sept. 3, 2018, 7:59 p.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
41289215 |
Suzukaze |
A |
Aug. 7, 2018, 12:54 a.m. |
OK |
Java 8 |
TESTS |
57 |
140 |
0 |
|
2100 |
39619751 |
ymatsux |
A |
June 24, 2018, 5:26 p.m. |
OK |
Kotlin |
TESTS |
57 |
186 |
102400 |
|
2100 |
39617295 |
elizarov |
A |
June 24, 2018, 5:11 p.m. |
OK |
Kotlin |
TESTS |
57 |
218 |
204800 |
|
2100 |
48655503 |
qgjz |
A |
Jan. 21, 2019, 2:20 a.m. |
OK |
MS C++ |
TESTS |
57 |
31 |
409600 |
|
2100 |
39615506 |
wa1tz719 |
A |
June 24, 2018, 5:01 p.m. |
OK |
MS C++ |
TESTS |
57 |
31 |
409600 |
|
2100 |
39645338 |
nik1998 |
A |
June 25, 2018, 9:48 a.m. |
OK |
MS C++ |
TESTS |
57 |
31 |
614400 |
|
2100 |
44893784 |
LoneFox |
A |
Oct. 26, 2018, 5:26 a.m. |
OK |
MS C++ |
TESTS |
57 |
31 |
2457600 |
|
2100 |
50067357 |
AndreWiking |
A |
Feb. 17, 2019, 3:32 p.m. |
OK |
MS C++ 2017 |
TESTS |
57 |
46 |
512000 |
|
2100 |
39740088 |
fruha |
A |
June 28, 2018, 10:40 a.m. |
OK |
PascalABC.NET |
TESTS |
57 |
233 |
2969600 |
|
2100 |
39865130 |
mayakin |
A |
July 2, 2018, 10:38 a.m. |
OK |
PHP |
TESTS |
57 |
46 |
4608000 |
|
2100 |
44840967 |
test616.cpp |
A |
Oct. 25, 2018, 12:45 p.m. |
OK |
PyPy 2 |
TESTS |
57 |
155 |
2048000 |
|
2100 |
41628459 |
Ferume |
A |
Aug. 15, 2018, 4:14 p.m. |
OK |
PyPy 2 |
TESTS |
57 |
405 |
7782400 |
|
2100 |
58998818 |
kopok2 |
A |
Aug. 18, 2019, 12:44 p.m. |
OK |
PyPy 3 |
TESTS |
57 |
171 |
3686400 |
|
2100 |
39642428 |
pikmike |
A |
June 25, 2018, 7:56 a.m. |
OK |
PyPy 3 |
TESTS |
57 |
202 |
3276800 |
|
2100 |
61333619 |
DimaLahtin |
A |
Sept. 26, 2019, 3:45 p.m. |
OK |
PyPy 3 |
TESTS |
57 |
202 |
7475200 |
|
2100 |
39612690 |
--d |
A |
June 24, 2018, 4:48 p.m. |
OK |
PyPy 3 |
TESTS |
57 |
218 |
2457600 |
|
2100 |
66804934 |
cameliapatilea |
A |
Dec. 13, 2019, 8:29 p.m. |
OK |
PyPy 3 |
TESTS |
57 |
234 |
6451200 |
|
2100 |
39952657 |
RagnarArdal |
A |
July 4, 2018, 11:15 a.m. |
OK |
PyPy 3 |
TESTS |
57 |
249 |
5939200 |
|
2100 |
39676254 |
greedybastard |
A |
June 26, 2018, 1:06 p.m. |
OK |
Python 2 |
TESTS |
57 |
109 |
409600 |
|
2100 |
39616564 |
WNG |
A |
June 24, 2018, 5:07 p.m. |
OK |
Python 2 |
TESTS |
57 |
124 |
512000 |
|
2100 |
44841145 |
test616.cpp |
A |
Oct. 25, 2018, 12:49 p.m. |
OK |
Python 2 |
TESTS |
57 |
187 |
1024000 |
|
2100 |
39807444 |
candle |
A |
June 30, 2018, 9:01 p.m. |
OK |
Python 2 |
TESTS |
57 |
233 |
512000 |
|
2100 |
39679005 |
orailly |
A |
June 26, 2018, 2:59 p.m. |
OK |
Python 3 |
TESTS |
57 |
93 |
614400 |
|
2100 |
42121195 |
Mk_Python_v1 |
A |
Aug. 26, 2018, 12:34 p.m. |
OK |
Python 3 |
TESTS |
57 |
109 |
512000 |
|
2100 |
39620825 |
almasip |
A |
June 24, 2018, 5:34 p.m. |
OK |
Python 3 |
TESTS |
57 |
124 |
614400 |
|
2100 |
39794064 |
mtarunsai1999 |
A |
June 30, 2018, 10:04 a.m. |
OK |
Python 3 |
TESTS |
57 |
155 |
409600 |
|
2100 |
39649076 |
denny_sem |
A |
June 25, 2018, 12:16 p.m. |
OK |
Python 3 |
TESTS |
57 |
171 |
614400 |
|
2100 |
39616060 |
xh286286 |
A |
June 24, 2018, 5:04 p.m. |
OK |
Python 3 |
TESTS |
57 |
233 |
1228800 |
|
2100 |
68851040 |
NocturneBflat |
A |
Jan. 15, 2020, 8:58 a.m. |
OK |
Python 3 |
TESTS |
57 |
343 |
1228800 |
|
2100 |
remove filters
Back to search problems