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 consisting of n elements. The imbalance value of some subsegment of this array is the difference between the maximum and minimum element from this segment. The imbalance value of the array is the sum of imbalance values of all subsegments of this array. For example, the imbalance value of array [1, xe2 x80 x894, xe2 x80 x891] is 9, because there are 6 different subsegments of this array: You have to determine the imbalance value of the array a. The first line contains one integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- size of the array a. The second line contains n integers a1, xe2 x80 x89a2... an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- elements of the array. Print one integer -- the imbalance value of a. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
45203558 |
playerzhou |
D |
Nov. 2, 2018, 11:28 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
42 |
530 |
35532800 |
|
2000 |
27844487 |
nanae1914 |
D |
June 17, 2017, 11:12 a.m. |
OK |
D |
TESTS |
42 |
327 |
61030400 |
|
2000 |
27821461 |
nanae1914 |
D |
June 16, 2017, 9:23 a.m. |
OK |
D |
TESTS |
42 |
327 |
61030400 |
|
2000 |
27814205 |
nanae1914 |
D |
June 16, 2017, 12:39 a.m. |
OK |
D |
TESTS |
42 |
451 |
61030400 |
|
2000 |
27813738 |
nanae1914 |
D |
June 15, 2017, 11:33 p.m. |
OK |
D |
TESTS |
42 |
982 |
81920000 |
|
2000 |
29327175 |
KagamiharaNadeshiko |
D |
Aug. 10, 2017, 1:09 p.m. |
OK |
FPC |
TESTS |
42 |
233 |
25702400 |
|
2000 |
27803315 |
ZzZZCHS |
D |
June 15, 2017, 4:17 p.m. |
OK |
FPC |
TESTS |
42 |
265 |
32153600 |
|
2000 |
27801777 |
tungtinhoctre126 |
D |
June 15, 2017, 3:58 p.m. |
OK |
FPC |
TESTS |
42 |
280 |
24064000 |
|
2000 |
64775075 |
HVP.exe |
D |
Nov. 13, 2019, 3:35 a.m. |
OK |
FPC |
TESTS |
42 |
296 |
28057600 |
|
2000 |
32367778 |
AsahiKasugano |
D |
Nov. 17, 2017, 1:35 a.m. |
OK |
FPC |
TESTS |
42 |
311 |
26828800 |
|
2000 |
28340076 |
AltF4 |
D |
July 7, 2017, 3:12 a.m. |
OK |
GNU C |
TESTS |
42 |
202 |
17920000 |
|
2000 |
27802075 |
sgtlaugh |
D |
June 15, 2017, 4:01 p.m. |
OK |
GNU C |
TESTS |
42 |
342 |
52121600 |
|
2000 |
27865671 |
rainboy |
D |
June 17, 2017, 4:53 p.m. |
OK |
GNU C |
TESTS |
42 |
514 |
16076800 |
|
2000 |
27801033 |
rainboy |
D |
June 15, 2017, 3:49 p.m. |
OK |
GNU C |
TESTS |
42 |
701 |
16076800 |
|
2000 |
33400454 |
Scut82 |
D |
Dec. 19, 2017, 7:37 a.m. |
OK |
GNU C++ |
TESTS |
42 |
62 |
18227200 |
|
2000 |
29302606 |
SoiMae |
D |
Aug. 9, 2017, 9:35 a.m. |
OK |
GNU C++ |
TESTS |
42 |
62 |
26419200 |
|
2000 |
32827814 |
Scut82 |
D |
Dec. 1, 2017, 11:16 a.m. |
OK |
GNU C++ |
TESTS |
42 |
77 |
18227200 |
|
2000 |
27818691 |
xzyxzy |
D |
June 16, 2017, 6:47 a.m. |
OK |
GNU C++ |
TESTS |
42 |
78 |
11980800 |
|
2000 |
27800465 |
yasugongshang |
D |
June 15, 2017, 3:44 p.m. |
OK |
GNU C++ |
TESTS |
42 |
78 |
20070400 |
|
2000 |
32006535 |
lsonan |
D |
Nov. 3, 2017, 12:06 p.m. |
OK |
GNU C++ |
TESTS |
42 |
78 |
22835200 |
|
2000 |
40980721 |
ReaLNero1 |
D |
July 30, 2018, 5:39 p.m. |
OK |
GNU C++ |
TESTS |
42 |
78 |
24268800 |
|
2000 |
28405577 |
DFPMTS |
D |
July 10, 2017, 11:13 a.m. |
OK |
GNU C++ |
TESTS |
42 |
93 |
14233600 |
|
2000 |
27835723 |
AkaneSasu |
D |
June 17, 2017, 1:22 a.m. |
OK |
GNU C++ |
TESTS |
42 |
93 |
19865600 |
|
2000 |
27835003 |
King_of_Paladins |
D |
June 16, 2017, 11:55 p.m. |
OK |
GNU C++ |
TESTS |
42 |
93 |
19865600 |
|
2000 |
27818698 |
zcyskyaa |
D |
June 16, 2017, 6:48 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
77 |
12595200 |
|
2000 |
64364956 |
luogu_bot3 |
D |
Nov. 6, 2019, 12:46 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
7987200 |
|
2000 |
64364886 |
Epworth |
D |
Nov. 6, 2019, 12:45 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
7987200 |
|
2000 |
27811712 |
Jhamra |
D |
June 15, 2017, 8:56 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
8499200 |
|
2000 |
68154186 |
vjudge3 |
D |
Jan. 4, 2020, 8:15 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
11878400 |
|
2000 |
27840600 |
1402806685 |
D |
June 17, 2017, 7:45 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
13414400 |
|
2000 |
65153533 |
sunny_fei |
D |
Nov. 16, 2019, 8:27 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
16384000 |
|
2000 |
69506681 |
vjudge2 |
D |
Jan. 25, 2020, 8:55 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
20070400 |
|
2000 |
27835419 |
ZYF1024 |
D |
June 17, 2017, 12:47 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
20275200 |
|
2000 |
28495407 |
hbxiaohao |
D |
July 13, 2017, 8:19 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
78 |
22323200 |
|
2000 |
52997367 |
vjudge2 |
D |
April 19, 2019, 4:57 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
187 |
7987200 |
|
2000 |
52997046 |
vjudge4 |
D |
April 19, 2019, 4:42 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
202 |
7987200 |
|
2000 |
28369441 |
pritam1989 |
D |
July 8, 2017, 12:54 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
202 |
22016000 |
|
2000 |
27801783 |
NormalCoder |
D |
June 15, 2017, 3:58 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
202 |
40038400 |
|
2000 |
27839147 |
mengxiang000 |
D |
June 17, 2017, 6:28 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
11980800 |
|
2000 |
29643482 |
whydotlet |
D |
Aug. 21, 2017, 12:33 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
12083200 |
|
2000 |
28694821 |
vjudge5 |
D |
July 19, 2017, 11:31 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
13926400 |
|
2000 |
28070555 |
lilala |
D |
June 27, 2017, 7:21 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
13926400 |
|
2000 |
28071425 |
lilala |
D |
June 27, 2017, 7:54 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
14028800 |
|
2000 |
27886152 |
zoooma13 |
D |
June 18, 2017, 2:19 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
218 |
16486400 |
|
2000 |
68154517 |
vjudge2 |
D |
Jan. 4, 2020, 8:24 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
11980800 |
|
2000 |
68101773 |
yan.silva |
D |
Jan. 3, 2020, 3:49 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
11980800 |
|
2000 |
47838914 |
CaNDidaTE_FaSTer |
D |
Jan. 2, 2019, 10:31 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
11980800 |
|
2000 |
68974222 |
vjudge4 |
D |
Jan. 17, 2020, 8:12 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
20070400 |
|
2000 |
68974157 |
qaqzwz |
D |
Jan. 17, 2020, 8:11 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
20070400 |
|
2000 |
44927519 |
slavik228 |
D |
Oct. 26, 2018, 8:59 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
20275200 |
|
2000 |
63772722 |
vjudge4 |
D |
Oct. 30, 2019, 8:33 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
24064000 |
|
2000 |
45889170 |
vjudge3 |
D |
Nov. 17, 2018, 5:43 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
24064000 |
|
2000 |
68150634 |
vjudge2 |
D |
Jan. 4, 2020, 6:45 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
28057600 |
|
2000 |
68150198 |
vjudge2 |
D |
Jan. 4, 2020, 6:34 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
280 |
28057600 |
|
2000 |
29263616 |
WangJialei |
D |
Aug. 7, 2017, 11:37 a.m. |
OK |
Go |
TESTS |
42 |
1279 |
85913600 |
|
2000 |
27845452 |
odomontois |
D |
June 17, 2017, 12:10 p.m. |
OK |
Haskell |
TESTS |
42 |
326 |
127283200 |
|
2000 |
27809893 |
odomontois |
D |
June 15, 2017, 7:13 p.m. |
OK |
Haskell |
TESTS |
42 |
857 |
138854400 |
|
2000 |
28011912 |
sl0th |
D |
June 24, 2017, 8:56 p.m. |
OK |
Haskell |
TESTS |
42 |
857 |
206848000 |
|
2000 |
28011705 |
sl0th |
D |
June 24, 2017, 8:34 p.m. |
OK |
Haskell |
TESTS |
42 |
858 |
206848000 |
|
2000 |
27809821 |
odomontois |
D |
June 15, 2017, 7:10 p.m. |
OK |
Haskell |
TESTS |
42 |
920 |
180940800 |
|
2000 |
27809721 |
odomontois |
D |
June 15, 2017, 7:05 p.m. |
OK |
Haskell |
TESTS |
42 |
920 |
180940800 |
|
2000 |
28011896 |
sl0th |
D |
June 24, 2017, 8:54 p.m. |
OK |
Haskell |
TESTS |
42 |
951 |
222617600 |
|
2000 |
28011819 |
sl0th |
D |
June 24, 2017, 8:47 p.m. |
OK |
Haskell |
TESTS |
42 |
966 |
222617600 |
|
2000 |
28011430 |
sl0th |
D |
June 24, 2017, 8:08 p.m. |
OK |
Haskell |
TESTS |
42 |
1060 |
224665600 |
|
2000 |
27809783 |
odomontois |
D |
June 15, 2017, 7:08 p.m. |
OK |
Haskell |
TESTS |
42 |
1263 |
205107200 |
|
2000 |
40649430 |
shirshbansal |
D |
July 22, 2018, 7:21 p.m. |
OK |
Java 8 |
TESTS |
42 |
202 |
6041600 |
|
2000 |
49229198 |
aman28rwt |
D |
Jan. 31, 2019, 3:53 a.m. |
OK |
Java 8 |
TESTS |
42 |
202 |
30617600 |
|
2000 |
27807064 |
uwi |
D |
June 15, 2017, 5:17 p.m. |
OK |
Java 8 |
TESTS |
42 |
233 |
14438400 |
|
2000 |
27809314 |
poikniok |
D |
June 15, 2017, 6:46 p.m. |
OK |
Java 8 |
TESTS |
42 |
264 |
14540800 |
|
2000 |
27977876 |
rrepeat |
D |
June 23, 2017, 6 a.m. |
OK |
Java 8 |
TESTS |
42 |
358 |
64512000 |
|
2000 |
27803440 |
Dukkha |
D |
June 15, 2017, 4:19 p.m. |
OK |
Java 8 |
TESTS |
42 |
374 |
33689600 |
|
2000 |
27803545 |
Azat_Yusupov |
D |
June 15, 2017, 4:21 p.m. |
OK |
Java 8 |
TESTS |
42 |
374 |
42291200 |
|
2000 |
43653056 |
hongquanntct |
D |
Oct. 1, 2018, 4:36 p.m. |
OK |
Java 8 |
TESTS |
42 |
389 |
42188800 |
|
2000 |
28196686 |
alibaba |
D |
July 1, 2017, 6:15 p.m. |
OK |
Java 8 |
TESTS |
42 |
389 |
70144000 |
|
2000 |
27965983 |
prashanth_rebala |
D |
June 22, 2017, 1:06 p.m. |
OK |
Java 8 |
TESTS |
42 |
389 |
99532800 |
|
2000 |
27805159 |
og.kostya |
D |
June 15, 2017, 4:45 p.m. |
OK |
MS C# |
TESTS |
42 |
187 |
30105600 |
|
2000 |
27810907 |
AnatolyTolstobrov |
D |
June 15, 2017, 8:06 p.m. |
OK |
MS C# |
TESTS |
42 |
499 |
35737600 |
|
2000 |
27809740 |
valergrad |
D |
June 15, 2017, 7:06 p.m. |
OK |
MS C# |
TESTS |
42 |
670 |
134144000 |
|
2000 |
46502200 |
vjudge5 |
D |
Dec. 2, 2018, 10:43 a.m. |
OK |
MS C++ |
TESTS |
42 |
202 |
11980800 |
|
2000 |
68150733 |
vjudge5 |
D |
Jan. 4, 2020, 6:47 a.m. |
OK |
MS C++ |
TESTS |
42 |
202 |
16076800 |
|
2000 |
27847846 |
lucyanna2018 |
D |
June 17, 2017, 2:29 p.m. |
OK |
MS C++ |
TESTS |
42 |
218 |
17920000 |
|
2000 |
27805484 |
nikvas |
D |
June 15, 2017, 4:50 p.m. |
OK |
MS C++ |
TESTS |
42 |
218 |
27136000 |
|
2000 |
27947452 |
olpetOdessaONU |
D |
June 21, 2017, 2:02 p.m. |
OK |
MS C++ |
TESTS |
42 |
264 |
54988800 |
|
2000 |
27802037 |
Leibniz_Zhang |
D |
June 15, 2017, 4:01 p.m. |
OK |
MS C++ |
TESTS |
42 |
327 |
38707200 |
|
2000 |
46113137 |
vjudge3 |
D |
Nov. 23, 2018, 12:45 p.m. |
OK |
MS C++ |
TESTS |
42 |
327 |
47411200 |
|
2000 |
27827389 |
mshcherba |
D |
June 16, 2017, 2:29 p.m. |
OK |
MS C++ |
TESTS |
42 |
343 |
35737600 |
|
2000 |
44316444 |
vjudge2 |
D |
Oct. 14, 2018, 12:18 p.m. |
OK |
MS C++ |
TESTS |
42 |
764 |
24371200 |
|
2000 |
27834875 |
Euler2718 |
D |
June 16, 2017, 11:41 p.m. |
OK |
MS C++ |
TESTS |
42 |
811 |
27136000 |
|
2000 |
54972979 |
codeshaker |
D |
June 2, 2019, 9:24 a.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
951 |
30310400 |
|
2000 |
61703981 |
psaini |
D |
Oct. 2, 2019, 9:27 a.m. |
OK |
PyPy 2 |
TESTS |
42 |
576 |
84480000 |
|
2000 |
27802810 |
code_kika |
D |
June 15, 2017, 4:10 p.m. |
OK |
PyPy 2 |
TESTS |
42 |
592 |
69120000 |
|
2000 |
42779511 |
Onesh0t |
D |
Sept. 11, 2018, 7:56 p.m. |
OK |
PyPy 2 |
TESTS |
42 |
982 |
99225600 |
|
2000 |
42779471 |
Onesh0t |
D |
Sept. 11, 2018, 7:54 p.m. |
OK |
PyPy 2 |
TESTS |
42 |
1060 |
99225600 |
|
2000 |
51377651 |
aleonov |
D |
March 16, 2019, 2:47 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1029 |
92467200 |
|
2000 |
50054990 |
r57shell |
D |
Feb. 17, 2019, 9:50 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
1122 |
92262400 |
|
2000 |
28391518 |
mattiasm83 |
D |
July 9, 2017, 5:09 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1232 |
105267200 |
|
2000 |
27802716 |
aayush9 |
D |
June 15, 2017, 4:09 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1341 |
81715200 |
|
2000 |
27826754 |
sas |
D |
June 16, 2017, 1:59 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1356 |
82432000 |
|
2000 |
55277196 |
artifexbm |
D |
June 7, 2019, 8:01 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1606 |
115200000 |
|
2000 |
27825962 |
wujuihsuan2016 |
D |
June 16, 2017, 1:21 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
1824 |
98201600 |
|
2000 |
remove filters
Back to search problems