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'There are three cells on an infinite 2-dimensional grid, labeled A , B , and F . Find the length of the shortest path from A to B if: The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the input. Then t test cases follow. Before each test case, there is an empty line. Each test case contains three lines. The first one contains two integers x_A, y_A ( 1 <= x_A, y_A <= 1000 ) -- coordinates of the start cell A . The second one contains two integers x_B, y_B ( 1 <= x_B, y_B <= 1000 ) -- coordinates of the finish cell B . The third one contains two integers x_F, y_F ( 1 <= x_F, y_F <= 1000 ) -- coordinates of the forbidden cell F . All cells are distinct. Coordinate x corresponds to the column number and coordinate y corresponds to the row number (see the pictures below). Output t lines. The i -th line should contain the answer for the i -th test case: the length of the shortest path from the cell A to the cell B if the cell F is not allowed to be visited. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
122027877 |
HuailongHuang |
A |
July 11, 2021, 1:28 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
2 |
46 |
0 |
|
|
122007350 |
Sakib62 |
A |
July 10, 2021, 5:24 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
2 |
264 |
0 |
|
|
122028112 |
EmSongAnDanh |
A |
July 11, 2021, 1:35 a.m. |
OK |
FPC |
TESTS |
2 |
46 |
0 |
|
|
122030935 |
phanthuydung |
A |
July 11, 2021, 2:51 a.m. |
OK |
FPC |
TESTS |
2 |
62 |
0 |
|
|
121998750 |
Pengjiajun |
A |
July 10, 2021, 4:44 p.m. |
OK |
GNU C11 |
TESTS |
2 |
31 |
0 |
|
|
122015289 |
kuba_422 |
A |
July 10, 2021, 7:02 p.m. |
OK |
GNU C11 |
TESTS |
2 |
31 |
0 |
|
|
122020928 |
tarun_2000 |
A |
July 10, 2021, 8:56 p.m. |
OK |
GNU C11 |
TESTS |
2 |
31 |
0 |
|
|
121998336 |
moonknight23 |
A |
July 10, 2021, 4:43 p.m. |
OK |
GNU C11 |
TESTS |
2 |
31 |
0 |
|
|
122035424 |
VamikShah |
A |
July 11, 2021, 4:30 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
|
122036240 |
H_a_c_kcode_gaurav |
A |
July 11, 2021, 4:48 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
|
122022686 |
Iizshit |
A |
July 10, 2021, 9:54 p.m. |
OK |
GNU C11 |
TESTS |
2 |
46 |
0 |
|
|
122034244 |
mayeed |
A |
July 11, 2021, 4:03 a.m. |
OK |
GNU C11 |
TESTS |
2 |
46 |
0 |
|
|
122034765 |
VamikShah |
A |
July 11, 2021, 4:14 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
|
122035107 |
VamikShah |
A |
July 11, 2021, 4:22 a.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
|
122027216 |
Yossef |
A |
July 11, 2021, 1:06 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122031499 |
Lotuses |
A |
July 11, 2021, 3:04 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122032499 |
naissante |
A |
July 11, 2021, 3:26 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122032558 |
vandoor |
A |
July 11, 2021, 3:27 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122034892 |
wangwanfu |
A |
July 11, 2021, 4:17 a.m. |
OK |
GNU C++11 |
TESTS |
3 |
15 |
0 |
|
|
122034335 |
BilibiliTDASC |
A |
July 11, 2021, 4:05 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122029203 |
jrhmq |
A |
July 11, 2021, 2:08 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122029175 |
jrhmq |
A |
July 11, 2021, 2:07 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122028568 |
ryanright |
A |
July 11, 2021, 1:49 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122027649 |
wind_Chaser |
A |
July 11, 2021, 1:21 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
15 |
0 |
|
|
122013196 |
ycoder_23 |
A |
July 10, 2021, 6:31 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
122003119 |
RaHuL7 |
A |
July 10, 2021, 4:53 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
122002989 |
_HossamYehia_ |
A |
July 10, 2021, 4:53 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
122027814 |
High_Score |
A |
July 11, 2021, 1:26 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
122034009 |
amritshukla001 |
A |
July 11, 2021, 3:58 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
15 |
0 |
|
|
122033870 |
Aayushi_Sharma |
A |
July 11, 2021, 3:55 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
15 |
0 |
|
|
122033903 |
super_3107 |
A |
July 11, 2021, 3:56 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
15 |
0 |
|
|
122039750 |
ziya69 |
A |
July 11, 2021, 5:56 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
0 |
|
|
122037483 |
ParthDwivedi |
A |
July 11, 2021, 5:13 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
0 |
|
|
122034295 |
parm_khakhar7 |
A |
July 11, 2021, 4:04 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
15 |
0 |
|
|
122030701 |
Serendipity_r |
A |
July 11, 2021, 2:46 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122034430 |
delta_raw |
A |
July 11, 2021, 4:06 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122031926 |
delta_raw |
A |
July 11, 2021, 3:13 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122031418 |
seeeagull |
A |
July 11, 2021, 3:02 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122029496 |
xiayufengchen |
A |
July 11, 2021, 2:16 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122014562 |
samkitshah1262 |
A |
July 10, 2021, 6:51 p.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
122039101 |
probro007 |
A |
July 11, 2021, 5:43 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
0 |
|
|
122040133 |
KRAT0S |
A |
July 11, 2021, 6:02 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
0 |
|
|
122039968 |
sakibmalik |
A |
July 11, 2021, 5:59 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
0 |
|
|
122038166 |
guddu75 |
A |
July 11, 2021, 5:27 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
0 |
|
|
122029155 |
sonali_2804 |
A |
July 11, 2021, 2:07 a.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122033747 |
jigsaw_20 |
A |
July 11, 2021, 3:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122038988 |
simply_hooman |
A |
July 11, 2021, 5:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
0 |
0 |
|
|
122013983 |
kevin |
A |
July 10, 2021, 6:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122009184 |
pavelmaltcev |
A |
July 10, 2021, 5:43 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122020898 |
HowOld |
A |
July 10, 2021, 8:56 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122028012 |
Bob15324 |
A |
July 11, 2021, 1:32 a.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
122037061 |
shajith_ham |
A |
July 11, 2021, 5:04 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
|
122038753 |
Mike4235 |
A |
July 11, 2021, 5:38 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
|
122039944 |
barats |
A |
July 11, 2021, 5:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
|
122012546 |
Reverie |
A |
July 10, 2021, 6:22 p.m. |
OK |
Go |
TESTS |
2 |
31 |
0 |
|
|
122015818 |
RetiredProgrammer |
A |
July 10, 2021, 7:10 p.m. |
OK |
Go |
TESTS |
2 |
31 |
0 |
|
|
122010490 |
Reverie |
A |
July 10, 2021, 5:58 p.m. |
OK |
Go |
TESTS |
2 |
46 |
102400 |
|
|
122002701 |
chemotaxis |
A |
July 10, 2021, 4:52 p.m. |
OK |
Go |
TESTS |
2 |
61 |
0 |
|
|
122015229 |
rego97 |
A |
July 10, 2021, 7:01 p.m. |
OK |
Haskell |
TESTS |
2 |
93 |
102400 |
|
|
122031917 |
Anuj_Panchal |
A |
July 11, 2021, 3:13 a.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
122022093 |
codebook_2000 |
A |
July 10, 2021, 9:32 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
122016670 |
npwolverine |
A |
July 10, 2021, 7:25 p.m. |
OK |
Java 11 |
TESTS |
2 |
171 |
0 |
|
|
122032745 |
kakashi19 |
A |
July 11, 2021, 3:32 a.m. |
OK |
Java 11 |
TESTS |
2 |
186 |
0 |
|
|
122005828 |
valeesi |
A |
July 10, 2021, 5:10 p.m. |
OK |
Java 11 |
TESTS |
2 |
186 |
102400 |
|
|
122009389 |
minhaziftekhar |
A |
July 10, 2021, 5:46 p.m. |
OK |
Java 11 |
TESTS |
2 |
233 |
0 |
|
|
122003358 |
GhoulvsTitan |
A |
July 10, 2021, 4:54 p.m. |
OK |
Java 11 |
TESTS |
2 |
248 |
0 |
|
|
122010756 |
ak_ankit |
A |
July 10, 2021, 6:01 p.m. |
OK |
Java 11 |
TESTS |
2 |
249 |
0 |
|
|
122028218 |
jamesfan961101 |
A |
July 11, 2021, 1:39 a.m. |
OK |
Java 11 |
TESTS |
2 |
264 |
102400 |
|
|
122027961 |
mitulgarg |
A |
July 11, 2021, 1:30 a.m. |
OK |
Java 11 |
TESTS |
2 |
265 |
0 |
|
|
122026084 |
Zatona |
A |
July 11, 2021, 12:18 a.m. |
OK |
Java 8 |
TESTS |
2 |
61 |
0 |
|
|
122021281 |
Snow |
A |
July 10, 2021, 9:07 p.m. |
OK |
Java 8 |
TESTS |
2 |
93 |
0 |
|
|
122024130 |
GVR |
A |
July 10, 2021, 10:50 p.m. |
OK |
Java 8 |
TESTS |
2 |
109 |
0 |
|
|
122015131 |
pranavggupta06 |
A |
July 10, 2021, 6:59 p.m. |
OK |
Java 8 |
TESTS |
2 |
109 |
0 |
|
|
122032359 |
Manan8686 |
A |
July 11, 2021, 3:23 a.m. |
OK |
Java 8 |
TESTS |
2 |
124 |
0 |
|
|
122017249 |
ExitCode |
A |
July 10, 2021, 7:34 p.m. |
OK |
Java 8 |
TESTS |
2 |
124 |
0 |
|
|
122029482 |
khalludi123 |
A |
July 11, 2021, 2:16 a.m. |
OK |
Java 8 |
TESTS |
2 |
140 |
0 |
|
|
121999579 |
prakhar71 |
A |
July 10, 2021, 4:45 p.m. |
OK |
Java 8 |
TESTS |
2 |
155 |
0 |
|
|
122021907 |
rv432233 |
A |
July 10, 2021, 9:26 p.m. |
OK |
Java 8 |
TESTS |
2 |
156 |
0 |
|
|
122034091 |
tryingDream |
A |
July 11, 2021, 3:59 a.m. |
OK |
Java 8 |
TESTS |
2 |
171 |
0 |
|
|
122036641 |
TRR |
A |
July 11, 2021, 4:54 a.m. |
OK |
Mono C# |
TESTS |
3 |
93 |
2969600 |
|
|
122029731 |
Flipped_ |
A |
July 11, 2021, 2:21 a.m. |
OK |
MS C++ |
TESTS |
2 |
46 |
0 |
|
|
122028752 |
yyeshell |
A |
July 11, 2021, 1:55 a.m. |
OK |
MS C++ |
TESTS |
2 |
78 |
0 |
|
|
122026860 |
overword |
A |
July 11, 2021, 12:53 a.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
30 |
0 |
|
|
122035892 |
dlehgns011 |
A |
July 11, 2021, 4:41 a.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
61 |
0 |
|
|
122010018 |
Ash_2k |
A |
July 10, 2021, 5:53 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
62 |
0 |
|
|
122006351 |
nikhileshbaghel |
A |
July 10, 2021, 5:15 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
62 |
0 |
|
|
122038374 |
UIgoku_watchMeTurnRed |
A |
July 11, 2021, 5:31 a.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
77 |
0 |
|
|
122015119 |
CtrlAlt |
A |
July 10, 2021, 6:59 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
77 |
0 |
|
|
122009562 |
whoisslimshady |
A |
July 10, 2021, 5:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
77 |
0 |
|
|
122007920 |
Tangerine |
A |
July 10, 2021, 5:30 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
77 |
0 |
|
|
122009206 |
ahmedm561 |
A |
July 10, 2021, 5:44 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
77 |
614400 |
|
|
122005362 |
ahmedhosny123456 |
A |
July 10, 2021, 5:06 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
78 |
0 |
|
|
122008130 |
Ahad726 |
A |
July 10, 2021, 5:32 p.m. |
OK |
.NET Core C# |
TESTS |
2 |
140 |
3788800 |
|
|
122007687 |
ShashankZobb |
A |
July 10, 2021, 5:27 p.m. |
OK |
PyPy 2 |
TESTS |
2 |
155 |
5017600 |
|
|
122018094 |
coden00b2021 |
A |
July 10, 2021, 7:51 p.m. |
OK |
PyPy 2 |
TESTS |
2 |
530 |
8192000 |
|
|
122023420 |
yash490 |
A |
July 10, 2021, 10:20 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
124 |
2764800 |
|
|
122035651 |
not_tehlka |
A |
July 11, 2021, 4:36 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
171 |
6758400 |
|
|
122016235 |
Mistaek |
A |
July 10, 2021, 7:17 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
186 |
9216000 |
|
|
122006450 |
Mr.Inconsistent |
A |
July 10, 2021, 5:16 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
186 |
9216000 |
|
|
122006289 |
Soul_Silver |
A |
July 10, 2021, 5:14 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
186 |
10444800 |
|
|
122017943 |
pk31299 |
A |
July 10, 2021, 7:48 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
202 |
8192000 |
|
|
122019363 |
Optimismy |
A |
July 10, 2021, 8:18 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
233 |
9420800 |
|
|
122028347 |
toilavu |
A |
July 11, 2021, 1:43 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
233 |
9932800 |
|
|
122026528 |
toilavu |
A |
July 11, 2021, 12:40 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
233 |
9932800 |
|
|
122036718 |
caow |
A |
July 11, 2021, 4:56 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
312 |
11878400 |
|
|
122011716 |
eugalt |
A |
July 10, 2021, 6:12 p.m. |
OK |
Python 3 |
TESTS |
2 |
77 |
1228800 |
|
|
122008965 |
eugalt |
A |
July 10, 2021, 5:41 p.m. |
OK |
Python 3 |
TESTS |
2 |
77 |
1228800 |
|
|
122008746 |
eugalt |
A |
July 10, 2021, 5:39 p.m. |
OK |
Python 3 |
TESTS |
2 |
77 |
1228800 |
|
|
122008682 |
eugalt |
A |
July 10, 2021, 5:38 p.m. |
OK |
Python 3 |
TESTS |
2 |
78 |
1228800 |
|
|
122008367 |
eugalt |
A |
July 10, 2021, 5:35 p.m. |
OK |
Python 3 |
TESTS |
2 |
92 |
1228800 |
|
|
122018971 |
Ayman2017 |
A |
July 10, 2021, 8:09 p.m. |
OK |
Python 3 |
TESTS |
2 |
93 |
102400 |
|
|
122010153 |
eugalt |
A |
July 10, 2021, 5:55 p.m. |
OK |
Python 3 |
TESTS |
2 |
93 |
1228800 |
|
|
122018687 |
Ayman2017 |
A |
July 10, 2021, 8:02 p.m. |
OK |
Python 3 |
TESTS |
2 |
109 |
102400 |
|
|
122002481 |
NeoCipher |
A |
July 10, 2021, 4:51 p.m. |
OK |
Python 3 |
TESTS |
2 |
139 |
512000 |
|
|
122014910 |
akshaywairagade2 |
A |
July 10, 2021, 6:56 p.m. |
OK |
Python 3 |
TESTS |
2 |
140 |
0 |
|
|
remove filters
Back to search problems