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 with n integers ai and m queries. Each query is described by two integers (lj, xe2 x80 x89rj). Let's define the function . The function is defined for only u xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v. For each query print the maximal value of the function f(ax, xe2 x80 x89ay) over all lj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89rj, xe2 x80 x89 ax xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ay. The first line contains two integers n, xe2 x80 x89m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7104, xe2 x80 x89 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7103) -- the size of the array and the number of the queries. The second line contains n integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the elements of the array a. Each of the next m lines contains two integers lj, xe2 x80 x89rj (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89lj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89rj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) xe2 x80 x93 the parameters of the j-th query. For each query print the value aj on a separate line -- the maximal value of the function f(ax, xe2 x80 x89ay) over all lj xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89rj, xe2 x80 x89 ax xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ay."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
15594075 |
immortalCO |
F |
Jan. 26, 2016, 1:30 p.m. |
OK |
GNU C++ |
TESTS |
22 |
202 |
81715200 |
|
2700 |
40985286 |
ReaLNero1 |
F |
July 30, 2018, 7:51 p.m. |
OK |
GNU C++ |
TESTS |
22 |
217 |
81715200 |
|
2700 |
15593948 |
immortalCO |
F |
Jan. 26, 2016, 1:25 p.m. |
OK |
GNU C++ |
TESTS |
22 |
296 |
81715200 |
|
2700 |
27302528 |
victbr |
F |
May 23, 2017, 1:44 p.m. |
OK |
GNU C++ |
TESTS |
22 |
1684 |
42393600 |
|
2700 |
27302586 |
victbr |
F |
May 23, 2017, 1:48 p.m. |
OK |
GNU C++ |
TESTS |
22 |
1699 |
42393600 |
|
2700 |
21934118 |
abcdef6199 |
F |
Oct. 31, 2016, 3:04 p.m. |
OK |
GNU C++ |
TESTS |
22 |
2074 |
56729600 |
|
2700 |
27984505 |
lgkm39 |
F |
June 23, 2017, 12:15 p.m. |
OK |
GNU C++ |
TESTS |
22 |
2167 |
7270400 |
|
2700 |
15554029 |
Practice_Scott |
F |
Jan. 24, 2016, 11:28 a.m. |
OK |
GNU C++ |
TESTS |
22 |
2214 |
4505600 |
|
2700 |
15553985 |
Practice_Scott |
F |
Jan. 24, 2016, 11:26 a.m. |
OK |
GNU C++ |
TESTS |
22 |
2214 |
4505600 |
|
2700 |
35750644 |
luogu_bot1 |
F |
Feb. 27, 2018, 3:49 a.m. |
OK |
GNU C++ |
TESTS |
22 |
2215 |
6860800 |
|
2700 |
44465978 |
Emma194 |
F |
Oct. 18, 2018, 2:17 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
1887 |
12492800 |
|
2700 |
44465456 |
Emma194 |
F |
Oct. 18, 2018, 1:27 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
1887 |
12492800 |
|
2700 |
22062091 |
pr3pony |
F |
Nov. 5, 2016, 5:51 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
1887 |
13721600 |
|
2700 |
15610892 |
krijgertje |
F |
Jan. 27, 2016, 11:59 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
1902 |
24371200 |
|
2700 |
22062076 |
pr3pony |
F |
Nov. 5, 2016, 5:50 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
1918 |
13721600 |
|
2700 |
22062160 |
pr3pony |
F |
Nov. 5, 2016, 5:55 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
1950 |
13721600 |
|
2700 |
15885068 |
bidzilya |
F |
Feb. 7, 2016, 7:10 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
1965 |
28569600 |
|
2700 |
22062208 |
pr3pony |
F |
Nov. 5, 2016, 5:58 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
2167 |
13721600 |
|
2700 |
15486457 |
LHiC |
F |
Jan. 21, 2016, 8:58 p.m. |
OK |
GNU C++11 |
TESTS |
22 |
2199 |
22835200 |
|
2700 |
36314371 |
RNS_MHB |
F |
March 16, 2018, 1:06 a.m. |
OK |
GNU C++11 |
TESTS |
22 |
2214 |
8192000 |
|
2700 |
25888154 |
shubhamgoyal__ |
F |
March 29, 2017, 5:45 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2105 |
147046400 |
|
2700 |
40196392 |
lacitirc |
F |
July 11, 2018, 9:27 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2277 |
5529600 |
|
2700 |
31973877 |
I_See_You |
F |
Nov. 2, 2017, 9:37 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2371 |
57139200 |
|
2700 |
31973941 |
vjudge2 |
F |
Nov. 2, 2017, 9:39 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2401 |
57241600 |
|
2700 |
38106148 |
tieunhi |
F |
May 11, 2018, 5:38 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2464 |
81817600 |
|
2700 |
30265438 |
NiroBC |
F |
Sept. 11, 2017, 12:35 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
2792 |
70144000 |
|
2700 |
25958299 |
Kmcode |
F |
March 30, 2017, 4:23 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
2854 |
6656000 |
|
2700 |
51728251 |
tsutaj1458 |
F |
March 22, 2019, 7:53 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
2916 |
4710400 |
|
2700 |
55715542 |
NotNight |
F |
June 18, 2019, 12:31 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
2932 |
49561600 |
|
2700 |
34962147 |
minhtung04042001 |
F |
Feb. 6, 2018, 6:10 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
2994 |
83046400 |
|
2700 |
62078003 |
Hoshi08 |
F |
Oct. 7, 2019, 7:15 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
1543 |
5222400 |
|
2700 |
63080067 |
misir |
F |
Oct. 21, 2019, 2:50 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
1559 |
4710400 |
|
2700 |
68474209 |
twangal |
F |
Jan. 10, 2020, 4:24 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
2667 |
28569600 |
|
2700 |
50425173 |
0442A403 |
F |
Feb. 24, 2019, 11:08 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
2667 |
361574400 |
|
2700 |
63275233 |
Ari |
F |
Oct. 24, 2019, 6:31 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
2870 |
11059200 |
|
2700 |
63275009 |
Ari |
F |
Oct. 24, 2019, 6:26 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
2870 |
11059200 |
|
2700 |
63274488 |
Ari |
F |
Oct. 24, 2019, 6:10 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
2916 |
11059200 |
|
2700 |
64866142 |
limabeans |
F |
Nov. 14, 2019, 6:18 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
3025 |
24064000 |
|
2700 |
51241987 |
w8_m8 |
F |
March 12, 2019, 11:27 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
3073 |
4505600 |
|
2700 |
60521334 |
AlexPanda |
F |
Sept. 14, 2019, 8:34 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
3104 |
49561600 |
|
2700 |
15487777 |
mkirsche |
F |
Jan. 22, 2016, 12:38 a.m. |
OK |
Java 7 |
TESTS |
22 |
9828 |
0 |
|
2700 |
15971519 |
fetetriste |
F |
Feb. 12, 2016, 1:37 p.m. |
OK |
Java 8 |
TESTS |
22 |
7097 |
58163200 |
|
2700 |
15481153 |
Egor |
F |
Jan. 21, 2016, 4:39 p.m. |
OK |
Java 8 |
TESTS |
22 |
7487 |
0 |
|
2700 |
15486700 |
ATailouloute |
F |
Jan. 21, 2016, 9:25 p.m. |
OK |
Java 8 |
TESTS |
22 |
9250 |
0 |
|
2700 |
15919135 |
fmoraes |
F |
Feb. 9, 2016, 5:48 p.m. |
OK |
Java 8 |
TESTS |
22 |
9313 |
0 |
|
2700 |
15487783 |
mkirsche |
F |
Jan. 22, 2016, 12:39 a.m. |
OK |
Java 8 |
TESTS |
22 |
9406 |
0 |
|
2700 |
15831595 |
Carups |
F |
Feb. 5, 2016, 6:49 p.m. |
OK |
MS C++ |
TESTS |
22 |
1356 |
18432000 |
|
2700 |
15578600 |
Perforator |
F |
Jan. 25, 2016, 5:07 p.m. |
OK |
MS C++ |
TESTS |
22 |
3400 |
55705600 |
|
2700 |
15635529 |
AleksanderBalobanov |
F |
Jan. 28, 2016, 7:45 p.m. |
OK |
MS C++ |
TESTS |
22 |
3478 |
12595200 |
|
2700 |
15924029 |
iblacksun |
F |
Feb. 10, 2016, 4:06 a.m. |
OK |
MS C++ |
TESTS |
22 |
7082 |
4505600 |
|
2700 |
15560294 |
Milanin |
F |
Jan. 24, 2016, 5:23 p.m. |
OK |
MS C++ |
TESTS |
22 |
8407 |
4300800 |
|
2700 |
remove filters
Back to search problems