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 an array a of n points in k -dimensional space. Let the distance between two points a_x and a_y be sum limits_{i = 1}^{k} |a_{x, i} - a_{y, i}| (it is also known as Manhattan distance). You have to process q queries of the following two types: The first line contains two numbers n and k ( 1 <= n <= 2 cdot 10^5 , 1 <= k <= 5 ) -- the number of elements in a and the number of dimensions of the space, respectively. Then n lines follow, each containing k integers a_{i, 1} , a_{i, 2} , ..., a_{i, k} ( -10^6 <= a_{i, j} <= 10^6 ) -- the coordinates of i -th point. The next line contains one integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of queries. Then q lines follow, each denoting a query. There are two types of queries: There is at least one query of the second type. Print the answer for each query of the second type. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
50154914 |
sansen |
G |
Feb. 19, 2019, 9:28 a.m. |
OK |
GNU C11 |
TESTS |
56 |
1357 |
67481600 |
|
2200 |
49504938 |
kvk1920 |
G |
Feb. 5, 2019, 5:04 p.m. |
OK |
GNU C11 |
TESTS |
56 |
2199 |
67276800 |
|
2200 |
47694128 |
rainboy |
G |
Dec. 29, 2018, 4:03 p.m. |
OK |
GNU C11 |
TESTS |
56 |
5724 |
209203200 |
|
2200 |
54406694 |
Ryochii |
G |
May 20, 2019, 6:50 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
374 |
102604800 |
|
2200 |
47168499 |
luogu_bot1 |
G |
Dec. 17, 2018, 1:44 p.m. |
OK |
GNU C++11 |
TESTS |
56 |
374 |
106393600 |
|
2200 |
47107033 |
c0per |
G |
Dec. 16, 2018, 1:27 p.m. |
OK |
GNU C++11 |
TESTS |
56 |
389 |
106393600 |
|
2200 |
58804339 |
ChthollyTree |
G |
Aug. 14, 2019, 8:24 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
389 |
114585600 |
|
2200 |
47542430 |
zhou2003 |
G |
Dec. 27, 2018, 7:57 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
389 |
133120000 |
|
2200 |
58804288 |
ChthollyTree |
G |
Aug. 14, 2019, 8:23 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
404 |
114585600 |
|
2200 |
47146670 |
HatsuneMikuo |
G |
Dec. 17, 2018, 3:10 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
405 |
118886400 |
|
2200 |
48654457 |
ReaLNero1 |
G |
Jan. 21, 2019, 1:33 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
420 |
106393600 |
|
2200 |
47298870 |
wang9897 |
G |
Dec. 20, 2018, 1:17 p.m. |
OK |
GNU C++11 |
TESTS |
56 |
421 |
106598400 |
|
2200 |
47241532 |
2735353930 |
G |
Dec. 19, 2018, 2:16 a.m. |
OK |
GNU C++11 |
TESTS |
56 |
436 |
173977600 |
|
2200 |
47275234 |
neal |
G |
Dec. 19, 2018, 6:53 p.m. |
OK |
GNU C++14 |
TESTS |
56 |
358 |
77004800 |
|
2200 |
47275177 |
neal |
G |
Dec. 19, 2018, 6:51 p.m. |
OK |
GNU C++14 |
TESTS |
56 |
374 |
77004800 |
|
2200 |
47550011 |
NiroBC |
G |
Dec. 27, 2018, 12:30 p.m. |
OK |
GNU C++14 |
TESTS |
56 |
389 |
73011200 |
|
2200 |
47146671 |
interestingLSY |
G |
Dec. 17, 2018, 3:10 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
390 |
118886400 |
|
2200 |
47250761 |
neal |
G |
Dec. 19, 2018, 8:09 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
452 |
77004800 |
|
2200 |
47250662 |
neal |
G |
Dec. 19, 2018, 8:06 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
467 |
77004800 |
|
2200 |
47250678 |
neal |
G |
Dec. 19, 2018, 8:07 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
499 |
77004800 |
|
2200 |
47250812 |
neal |
G |
Dec. 19, 2018, 8:10 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
623 |
77004800 |
|
2200 |
47239745 |
dtc03012 |
G |
Dec. 19, 2018, 12:03 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
655 |
118476800 |
|
2200 |
47250147 |
neal |
G |
Dec. 19, 2018, 7:52 a.m. |
OK |
GNU C++14 |
TESTS |
56 |
779 |
86016000 |
|
2200 |
47076107 |
Medeowex |
G |
Dec. 15, 2018, 5:12 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
857 |
106598400 |
|
2200 |
47357567 |
yum |
G |
Dec. 22, 2018, 7:01 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
857 |
106598400 |
|
2200 |
47127135 |
pranet |
G |
Dec. 16, 2018, 3:51 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
858 |
60928000 |
|
2200 |
47241529 |
Liwj |
G |
Dec. 19, 2018, 2:16 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
873 |
107417600 |
|
2200 |
50963986 |
KrK |
G |
March 7, 2019, 4:30 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
873 |
138547200 |
|
2200 |
47127389 |
pranet |
G |
Dec. 16, 2018, 3:53 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
889 |
62259200 |
|
2200 |
47397069 |
Pepcy_Ch |
G |
Dec. 23, 2018, 11:54 a.m. |
OK |
GNU C++17 |
TESTS |
56 |
935 |
61952000 |
|
2200 |
53908263 |
Stepavly |
G |
May 9, 2019, 1:59 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
935 |
71270400 |
|
2200 |
53908222 |
Stepavly |
G |
May 9, 2019, 1:57 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
935 |
71372800 |
|
2200 |
47176549 |
Son |
G |
Dec. 17, 2018, 5:50 p.m. |
OK |
GNU C++17 |
TESTS |
56 |
967 |
128512000 |
|
2200 |
47107260 |
jenish9599 |
G |
Dec. 16, 2018, 1:34 p.m. |
OK |
Java 8 |
TESTS |
56 |
1871 |
58265600 |
|
2200 |
47671765 |
aminul |
G |
Dec. 29, 2018, 6:31 a.m. |
OK |
Java 8 |
TESTS |
56 |
1965 |
58163200 |
|
2200 |
47098649 |
indy256 |
G |
Dec. 16, 2018, 9:37 a.m. |
OK |
Java 8 |
TESTS |
56 |
2059 |
58163200 |
|
2200 |
48107483 |
jiangzhiyu1987 |
G |
Jan. 9, 2019, 6:41 a.m. |
OK |
Java 8 |
TESTS |
56 |
2074 |
58368000 |
|
2200 |
47326398 |
Noureldin |
G |
Dec. 21, 2018, 10:38 a.m. |
OK |
Java 8 |
TESTS |
56 |
2900 |
153702400 |
|
2200 |
47142674 |
Ahmad |
G |
Dec. 16, 2018, 9:20 p.m. |
OK |
Java 8 |
TESTS |
56 |
3025 |
133120000 |
|
2200 |
47205557 |
hongquanntct |
G |
Dec. 18, 2018, 3:01 p.m. |
OK |
Java 8 |
TESTS |
56 |
3338 |
222515200 |
|
2200 |
48587361 |
wadissimo |
G |
Jan. 19, 2019, 8:52 p.m. |
OK |
Java 8 |
TESTS |
56 |
3775 |
209408000 |
|
2200 |
47707333 |
Dukkha |
G |
Dec. 29, 2018, 9:46 p.m. |
OK |
Java 8 |
TESTS |
56 |
4289 |
134451200 |
|
2200 |
47410358 |
Morgan_Y |
G |
Dec. 23, 2018, 2:03 p.m. |
OK |
Java 8 |
TESTS |
56 |
4429 |
177254400 |
|
2200 |
47290311 |
peregrinus |
G |
Dec. 20, 2018, 8:47 a.m. |
OK |
Mono C# |
TESTS |
56 |
3712 |
152985600 |
|
2200 |
47082419 |
omikad |
G |
Dec. 15, 2018, 9:04 p.m. |
OK |
Mono C# |
TESTS |
56 |
5896 |
145100800 |
|
2200 |
47092483 |
LLI_E_P_JI_O_K |
G |
Dec. 16, 2018, 6:48 a.m. |
OK |
MS C++ |
TESTS |
56 |
1637 |
67276800 |
|
2200 |
48499555 |
DavitMarg |
G |
Jan. 17, 2019, 2:24 p.m. |
OK |
MS C++ |
TESTS |
56 |
5568 |
484147200 |
|
2200 |
59778497 |
siwei |
G |
Aug. 31, 2019, 1:32 a.m. |
OK |
MS C++ 2017 |
TESTS |
56 |
4336 |
95129600 |
|
2200 |
47084222 |
pajenegod |
G |
Dec. 15, 2018, 11:27 p.m. |
OK |
PyPy 2 |
TESTS |
56 |
4648 |
131174400 |
|
2200 |
60701508 |
sansen |
G |
Sept. 17, 2019, 1:02 a.m. |
OK |
Rust |
TESTS |
56 |
1512 |
100966400 |
|
2200 |
47186514 |
yakamoto |
G |
Dec. 18, 2018, 5:02 a.m. |
OK |
Scala |
TESTS |
56 |
2947 |
66048000 |
|
2200 |
47186520 |
yakamoto |
G |
Dec. 18, 2018, 5:02 a.m. |
OK |
Scala |
TESTS |
56 |
3042 |
66048000 |
|
2200 |
47075526 |
limed |
G |
Dec. 15, 2018, 5:03 p.m. |
OK |
Scala |
TESTS |
56 |
5912 |
105472000 |
|
2200 |
47075364 |
limed |
G |
Dec. 15, 2018, 5 p.m. |
OK |
Scala |
TESTS |
56 |
5958 |
105472000 |
|
2200 |
remove filters
Back to search problems