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 have to restore the wall. The wall consists of N pillars of bricks, the height of the i -th pillar is initially equal to h_{i} , the height is measured in number of bricks. After the restoration all the N pillars should have equal heights. You are allowed the following operations: You cannot create additional pillars or ignore some of pre-existing pillars even if their height becomes 0 . What is the minimal total cost of restoration, in other words, what is the minimal total cost to make all the pillars of equal height? The first line of input contains four integers N , A , R , M ( 1 <= N <= 10^{5} , 0 <= A, R, M <= 10^{4} ) -- the number of pillars and the costs of operations. The second line contains N integers h_{i} ( 0 <= h_{i} <= 10^{9} ) -- initial heights of pillars. Print one integer -- the minimal cost of restoration. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
81362197 |
vjudge4 |
E |
May 25, 2020, 8:23 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
35 |
280 |
921600 |
|
2100 |
81679312 |
Raeee |
E |
May 28, 2020, 7:08 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
35 |
623 |
1638400 |
|
2100 |
80542448 |
ruban |
E |
May 17, 2020, 5:26 p.m. |
OK |
Delphi |
TESTS |
35 |
140 |
131174400 |
|
2100 |
80395456 |
Chipe1 |
E |
May 16, 2020, 4:38 p.m. |
OK |
GNU C11 |
TESTS |
33 |
61 |
4096000 |
|
2100 |
80395304 |
Chipe1 |
E |
May 16, 2020, 4:37 p.m. |
OK |
GNU C11 |
TESTS |
33 |
61 |
4096000 |
|
2100 |
80737301 |
zhtjtcz |
E |
May 20, 2020, 3:18 a.m. |
OK |
GNU C++11 |
TESTS |
35 |
31 |
1638400 |
|
2100 |
80524337 |
vjudge4 |
E |
May 17, 2020, 1:36 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
31 |
5632000 |
|
2100 |
80581201 |
__Orchidany |
E |
May 18, 2020, 7:59 a.m. |
OK |
GNU C++11 |
TESTS |
35 |
31 |
7065600 |
|
2100 |
80940520 |
vjudge1 |
E |
May 22, 2020, 2:09 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
409600 |
|
2100 |
80697323 |
WULI |
E |
May 19, 2020, 2:24 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1228800 |
|
2100 |
80862213 |
phungha |
E |
May 21, 2020, 2:36 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1228800 |
|
2100 |
80948462 |
anodiebird |
E |
May 22, 2020, 3:38 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1228800 |
|
2100 |
80766633 |
Vxlimo |
E |
May 20, 2020, 11:19 a.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1433600 |
|
2100 |
81057042 |
Tommy0103 |
E |
May 24, 2020, 3:05 a.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1433600 |
|
2100 |
80771316 |
WULI |
E |
May 20, 2020, 12:19 p.m. |
OK |
GNU C++11 |
TESTS |
35 |
46 |
1433600 |
|
2100 |
81456223 |
CoffeeSS |
E |
May 26, 2020, 9:35 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
46 |
1228800 |
|
2100 |
80753284 |
shogun4200 |
E |
May 20, 2020, 8:16 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
46 |
1228800 |
|
2100 |
81461678 |
lucky_21 |
E |
May 26, 2020, 10:51 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80424428 |
mahadi97 |
E |
May 17, 2020, 1:49 a.m. |
OK |
GNU C++14 |
TESTS |
34 |
46 |
5324800 |
|
2100 |
80780658 |
_Rise |
E |
May 20, 2020, 2:23 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
46 |
16281600 |
|
2100 |
81610054 |
arv77 |
E |
May 27, 2020, 11:06 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
61 |
1228800 |
|
2100 |
80902514 |
Hassanosama |
E |
May 22, 2020, 5:07 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
61 |
1228800 |
|
2100 |
80658059 |
kakarotto_sama |
E |
May 19, 2020, 5:53 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
61 |
1638400 |
|
2100 |
80810625 |
YouAreFantastic |
E |
May 20, 2020, 11:12 p.m. |
OK |
GNU C++14 |
TESTS |
35 |
61 |
1638400 |
|
2100 |
81172244 |
prince_gupta |
E |
May 24, 2020, 11:48 a.m. |
OK |
GNU C++14 |
TESTS |
35 |
61 |
1843200 |
|
2100 |
80950346 |
nik_y |
E |
May 22, 2020, 4 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80672887 |
TaiRA |
E |
May 19, 2020, 9:26 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
46 |
1638400 |
|
2100 |
81687380 |
Trung_X_Hieu |
E |
May 28, 2020, 8:49 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
46 |
3379200 |
|
2100 |
80617998 |
user14767553 |
E |
May 18, 2020, 3:36 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
46 |
4915200 |
|
2100 |
81475757 |
Nanored |
E |
May 26, 2020, 1:38 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
1024000 |
|
2100 |
80697376 |
yashvardhan29 |
E |
May 19, 2020, 2:24 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
1024000 |
|
2100 |
81648017 |
PhuongPeu |
E |
May 27, 2020, 6:43 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
1433600 |
|
2100 |
80743503 |
_nicktz1408_ |
E |
May 20, 2020, 5:46 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
1638400 |
|
2100 |
81416063 |
THINKFASTER |
E |
May 25, 2020, 7:10 p.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
1638400 |
|
2100 |
80760403 |
wolverine16 |
E |
May 20, 2020, 9:55 a.m. |
OK |
GNU C++17 |
TESTS |
35 |
61 |
2457600 |
|
2100 |
81568229 |
Ormlis |
E |
May 26, 2020, 11:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
409600 |
|
2100 |
80735818 |
Alchemist0 |
E |
May 20, 2020, 2:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
409600 |
|
2100 |
81628031 |
MrBrionix |
E |
May 27, 2020, 2:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
819200 |
|
2100 |
80688842 |
Red-Dragon |
E |
May 19, 2020, 12:52 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80791130 |
syawl-1017 |
E |
May 20, 2020, 4:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80791102 |
syawl-1017 |
E |
May 20, 2020, 4:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80762920 |
Phortox |
E |
May 20, 2020, 10:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80702519 |
kvutxdy |
E |
May 19, 2020, 3:16 p.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
80659899 |
IncubatorMan |
E |
May 19, 2020, 6:19 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
1638400 |
|
2100 |
81358369 |
Mevan_Niluminda |
E |
May 25, 2020, 7:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
35 |
46 |
2048000 |
|
2100 |
80397834 |
asdsteven2 |
E |
May 16, 2020, 5:03 p.m. |
OK |
Go |
TESTS |
33 |
77 |
22630400 |
|
2100 |
81410305 |
tweety |
E |
May 25, 2020, 6:08 p.m. |
OK |
Go |
TESTS |
35 |
139 |
1228800 |
|
2100 |
80577306 |
avijit_agarwal |
E |
May 18, 2020, 7:02 a.m. |
OK |
Java 11 |
TESTS |
35 |
217 |
23961600 |
|
2100 |
80853575 |
prefixsum |
E |
May 21, 2020, 12:56 p.m. |
OK |
Java 11 |
TESTS |
35 |
218 |
0 |
|
2100 |
80809525 |
dauom |
E |
May 20, 2020, 10:25 p.m. |
OK |
Java 11 |
TESTS |
35 |
218 |
0 |
|
2100 |
80735837 |
anhpp |
E |
May 20, 2020, 2:43 a.m. |
OK |
Java 11 |
TESTS |
35 |
218 |
0 |
|
2100 |
80417253 |
TheSawan |
E |
May 16, 2020, 9:39 p.m. |
OK |
Java 11 |
TESTS |
34 |
233 |
24064000 |
|
2100 |
80417368 |
TheSawan |
E |
May 16, 2020, 9:42 p.m. |
OK |
Java 11 |
TESTS |
34 |
233 |
24166400 |
|
2100 |
80423463 |
derrick20 |
E |
May 17, 2020, 1:16 a.m. |
OK |
Java 11 |
TESTS |
34 |
233 |
24166400 |
|
2100 |
80980211 |
zhupeijun |
E |
May 23, 2020, 3:25 a.m. |
OK |
Java 11 |
TESTS |
35 |
234 |
0 |
|
2100 |
81439599 |
yuruiyin |
E |
May 26, 2020, 5:52 a.m. |
OK |
Java 11 |
TESTS |
35 |
264 |
0 |
|
2100 |
81440098 |
yuruiyin |
E |
May 26, 2020, 6 a.m. |
OK |
Java 11 |
TESTS |
35 |
265 |
0 |
|
2100 |
80543658 |
mufaddalnaya |
E |
May 17, 2020, 5:43 p.m. |
OK |
Java 8 |
TESTS |
35 |
124 |
20377600 |
|
2100 |
80513535 |
luchy0120 |
E |
May 17, 2020, 11:28 a.m. |
OK |
Java 8 |
TESTS |
35 |
140 |
20992000 |
|
2100 |
80819996 |
horseprabhat625 |
E |
May 21, 2020, 4:41 a.m. |
OK |
Java 8 |
TESTS |
35 |
155 |
0 |
|
2100 |
80428759 |
tsumit023 |
E |
May 17, 2020, 3:41 a.m. |
OK |
Java 8 |
TESTS |
34 |
155 |
20684800 |
|
2100 |
80428479 |
tsumit023 |
E |
May 17, 2020, 3:34 a.m. |
OK |
Java 8 |
TESTS |
34 |
155 |
20684800 |
|
2100 |
80771778 |
In_The_Name_Of_Love |
E |
May 20, 2020, 12:25 p.m. |
OK |
Java 8 |
TESTS |
35 |
171 |
0 |
|
2100 |
80625150 |
Agnimandur |
E |
May 18, 2020, 4:59 p.m. |
OK |
Java 8 |
TESTS |
35 |
171 |
0 |
|
2100 |
80402205 |
DanielW48 |
E |
May 16, 2020, 5:50 p.m. |
OK |
Java 8 |
TESTS |
34 |
171 |
20582400 |
|
2100 |
80395831 |
grekiki |
E |
May 16, 2020, 4:42 p.m. |
OK |
Java 8 |
TESTS |
33 |
171 |
20582400 |
|
2100 |
80424368 |
MohamedK |
E |
May 17, 2020, 1:47 a.m. |
OK |
Java 8 |
TESTS |
34 |
171 |
20889600 |
|
2100 |
81162809 |
Spheniscine |
E |
May 24, 2020, 9:40 a.m. |
OK |
Kotlin |
TESTS |
35 |
171 |
1126400 |
|
2100 |
81151089 |
Spheniscine |
E |
May 24, 2020, 8:52 a.m. |
OK |
Kotlin |
TESTS |
35 |
171 |
1126400 |
|
2100 |
81057305 |
Spheniscine |
E |
May 24, 2020, 3:14 a.m. |
OK |
Kotlin |
TESTS |
35 |
171 |
1126400 |
|
2100 |
80967813 |
Fortin |
E |
May 22, 2020, 8:11 p.m. |
OK |
Kotlin |
TESTS |
35 |
233 |
0 |
|
2100 |
80416437 |
DeadInsideOnTest993 |
E |
May 16, 2020, 9:18 p.m. |
OK |
Kotlin |
TESTS |
34 |
295 |
20684800 |
|
2100 |
81055872 |
UD_xlinsist |
E |
May 24, 2020, 2:23 a.m. |
OK |
Kotlin |
TESTS |
35 |
327 |
7372800 |
|
2100 |
80982598 |
duckladydinh |
E |
May 23, 2020, 4:27 a.m. |
OK |
Kotlin |
TESTS |
35 |
733 |
7065600 |
|
2100 |
80983554 |
duckladydinh |
E |
May 23, 2020, 4:48 a.m. |
OK |
Kotlin |
TESTS |
35 |
966 |
7065600 |
|
2100 |
80983426 |
duckladydinh |
E |
May 23, 2020, 4:45 a.m. |
OK |
Kotlin |
TESTS |
35 |
997 |
7065600 |
|
2100 |
80983241 |
duckladydinh |
E |
May 23, 2020, 4:42 a.m. |
OK |
Kotlin |
TESTS |
35 |
997 |
7065600 |
|
2100 |
81451790 |
tepamid |
E |
May 26, 2020, 8:34 a.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
77 |
1433600 |
|
2100 |
80756066 |
ningBr |
E |
May 20, 2020, 8:55 a.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
78 |
1126400 |
|
2100 |
81153194 |
Najmus_Sakib_Rashid |
E |
May 24, 2020, 9:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
124 |
1638400 |
|
2100 |
80628810 |
LSD |
E |
May 18, 2020, 5:51 p.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
156 |
819200 |
|
2100 |
80569918 |
0Mordecai0 |
E |
May 18, 2020, 5:07 a.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
156 |
5324800 |
|
2100 |
81095918 |
The_Michael |
E |
May 24, 2020, 6:02 a.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
171 |
409600 |
|
2100 |
80608941 |
greysheep |
E |
May 18, 2020, 1:59 p.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
171 |
4096000 |
|
2100 |
80527440 |
Ancient_mage |
E |
May 17, 2020, 2:14 p.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
202 |
6451200 |
|
2100 |
81418610 |
Alternek |
E |
May 25, 2020, 7:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
35 |
218 |
1638400 |
|
2100 |
80847001 |
EM1NEM |
E |
May 21, 2020, 11:32 a.m. |
OK |
PyPy 2 |
TESTS |
35 |
171 |
9011200 |
|
2100 |
80412418 |
rajasbansal1998 |
E |
May 16, 2020, 8:02 p.m. |
OK |
PyPy 2 |
TESTS |
34 |
296 |
46080000 |
|
2100 |
81368976 |
yumtam |
E |
May 25, 2020, 9:48 a.m. |
OK |
PyPy 2 |
TESTS |
35 |
514 |
7884800 |
|
2100 |
80412003 |
700atpid |
E |
May 16, 2020, 7:55 p.m. |
OK |
PyPy 2 |
TESTS |
34 |
592 |
33280000 |
|
2100 |
80411965 |
700atpid |
E |
May 16, 2020, 7:54 p.m. |
OK |
PyPy 2 |
TESTS |
34 |
607 |
33587200 |
|
2100 |
80411897 |
700atpid |
E |
May 16, 2020, 7:53 p.m. |
OK |
PyPy 2 |
TESTS |
34 |
623 |
33894400 |
|
2100 |
80422485 |
mkawa2 |
E |
May 17, 2020, 12:42 a.m. |
OK |
PyPy 3 |
TESTS |
34 |
265 |
34508800 |
|
2100 |
80405614 |
FireBird23 |
E |
May 16, 2020, 6:31 p.m. |
OK |
PyPy 3 |
TESTS |
34 |
265 |
39833600 |
|
2100 |
80404783 |
FireBird23 |
E |
May 16, 2020, 6:20 p.m. |
OK |
PyPy 3 |
TESTS |
34 |
265 |
39936000 |
|
2100 |
80865357 |
ycui11 |
E |
May 21, 2020, 3:10 p.m. |
OK |
PyPy 3 |
TESTS |
35 |
295 |
11878400 |
|
2100 |
81362164 |
shamio |
E |
May 25, 2020, 8:23 a.m. |
OK |
PyPy 3 |
TESTS |
35 |
296 |
16076800 |
|
2100 |
80390263 |
qwertz73355a |
E |
May 16, 2020, 3:51 p.m. |
OK |
PyPy 3 |
TESTS |
33 |
311 |
30822400 |
|
2100 |
80405266 |
FireBird23 |
E |
May 16, 2020, 6:27 p.m. |
OK |
PyPy 3 |
TESTS |
34 |
311 |
40140800 |
|
2100 |
80405346 |
FireBird23 |
E |
May 16, 2020, 6:28 p.m. |
OK |
PyPy 3 |
TESTS |
34 |
312 |
39936000 |
|
2100 |
80778535 |
zqx1392 |
E |
May 20, 2020, 1:56 p.m. |
OK |
PyPy 3 |
TESTS |
35 |
327 |
15360000 |
|
2100 |
81574879 |
shamio |
E |
May 27, 2020, 2:49 a.m. |
OK |
PyPy 3 |
TESTS |
35 |
327 |
16076800 |
|
2100 |
80388365 |
code1194 |
E |
May 16, 2020, 3:36 p.m. |
OK |
Python 3 |
TESTS |
33 |
405 |
15462400 |
|
2100 |
80910387 |
Pierroteknik |
E |
May 22, 2020, 7:15 a.m. |
OK |
Python 3 |
TESTS |
35 |
467 |
8704000 |
|
2100 |
80852995 |
ItayOtto |
E |
May 21, 2020, 12:48 p.m. |
OK |
Python 3 |
TESTS |
35 |
966 |
8908800 |
|
2100 |
80437697 |
142 |
E |
May 17, 2020, 6:09 a.m. |
OK |
Python 3 |
TESTS |
35 |
997 |
15667200 |
|
2100 |
80869842 |
zuun7 |
E |
May 21, 2020, 4:04 p.m. |
OK |
Python 3 |
TESTS |
35 |
998 |
8908800 |
|
2100 |
remove filters
Back to search problems