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"The good times at Heidi's library are over. Marmots finally got their internet connections and stopped coming to the library altogether. Not only that, but the bookstore has begun charging extortionate prices for some books. Namely, whereas in the previous versions each book could be bought for 1 CHF, now the price of book i is ci CHF. The first line of input will contain two integers n and k (). The second line will contain n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) xe2 x80 x93 the sequence of book requests. The third line contains n integers c1, xe2 x80 x89c2, xe2 x80 x89..., xe2 x80 x89cn (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) xe2 x80 x93 the costs of the books. On a single line print the minimum cost of buying books at the store so as to satisfy all requests. The first three sample cases are repeated, but the fourth one is new. In the fourth test case, when buying book 3, Heidi should discard either book 1 or 2. Even though book 2 will be requested later than book 1, she should keep it, because it is so expensive to buy again."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
27523706 |
jasonvictoryan |
C |
June 2, 2017, 12:40 p.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
0 |
|
2700 |
27426908 |
liympanda cuiaoxiang |
C |
May 29, 2017, 9:39 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
102400 |
|
2700 |
27417301 |
tbw1033 |
C |
May 28, 2017, 5:22 p.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
204800 |
|
2700 |
27566498 |
ryo_issy |
C |
June 4, 2017, 3:07 p.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
307200 |
|
2700 |
27412876 |
krijgertje |
C |
May 28, 2017, 12:33 p.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
307200 |
|
2700 |
27407775 |
King_George rqgao2014 |
C |
May 28, 2017, 9:43 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
307200 |
|
2700 |
27750768 |
RedTea |
C |
June 13, 2017, 7:18 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
409600 |
|
2700 |
27408914 |
rng_58 |
C |
May 28, 2017, 10:17 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
409600 |
|
2700 |
27410894 |
black_horse2014 |
C |
May 28, 2017, 11:24 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
512000 |
|
2700 |
27536567 |
AkaneSasu |
C |
June 3, 2017, 5:32 a.m. |
OK |
GNU C++ |
TESTS |
64 |
15 |
1433600 |
|
2700 |
27602302 |
1102301 |
C |
June 6, 2017, 12:27 a.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
0 |
|
2700 |
27471307 |
mywaythere |
C |
May 31, 2017, 4:41 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
0 |
|
2700 |
27405082 |
FizzyDavid ohweonfire |
C |
May 28, 2017, 8:41 a.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
0 |
|
2700 |
31703811 |
arjundabra |
C |
Oct. 25, 2017, 9:14 a.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
102400 |
|
2700 |
27409824 |
I_love_Hoang_Yen chemthan phamvanhanhgoldIOI2015 |
C |
May 28, 2017, 10:47 a.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
102400 |
|
2700 |
27471726 |
754986421653 |
C |
May 31, 2017, 5:14 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
409600 |
|
2700 |
27453702 |
sdedalus |
C |
May 30, 2017, 6:25 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
512000 |
|
2700 |
27523485 |
problem-solved |
C |
June 2, 2017, 12:28 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
819200 |
|
2700 |
27523019 |
problem-solved |
C |
June 2, 2017, 12:05 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
819200 |
|
2700 |
27419616 |
HanwhaEagles |
C |
May 28, 2017, 8:43 p.m. |
OK |
GNU C++11 |
TESTS |
64 |
15 |
2048000 |
|
2700 |
27425427 |
FallDream |
C |
May 29, 2017, 8:06 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
102400 |
|
2700 |
27424997 |
FallDream |
C |
May 29, 2017, 7:36 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
102400 |
|
2700 |
29842593 |
alex9801 conflict ko_osaga |
C |
Aug. 28, 2017, 9:55 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27778001 |
gigime |
C |
June 14, 2017, 6:05 p.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27548024 |
Rafaaaaaaaaaaaam |
C |
June 3, 2017, 3:42 p.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27411933 |
yutaka1999 |
C |
May 28, 2017, 12:03 p.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27408862 |
sigma425 sugim48 yosupo |
C |
May 28, 2017, 10:16 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27407943 |
irkstepanov AndreySergunin |
C |
May 28, 2017, 9:49 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
204800 |
|
2700 |
27843864 |
haleyk100198 |
C |
June 17, 2017, 10:34 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
307200 |
|
2700 |
27410415 |
dotorya zigui molamola. |
C |
May 28, 2017, 11:07 a.m. |
OK |
GNU C++14 |
TESTS |
64 |
15 |
307200 |
|
2700 |
53215515 |
vjudge5 |
C |
April 24, 2019, 8:33 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
0 |
|
2700 |
53214757 |
swust5120177231 |
C |
April 24, 2019, 8:05 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
0 |
|
2700 |
53214736 |
vjudge5 |
C |
April 24, 2019, 8:05 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
0 |
|
2700 |
53199108 |
swust5120177231 |
C |
April 23, 2019, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
0 |
|
2700 |
53199105 |
vjudge2 |
C |
April 23, 2019, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
0 |
|
2700 |
67559785 |
Martin53 |
C |
Dec. 24, 2019, 5:16 p.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
409600 |
|
2700 |
46396245 |
DZYO |
C |
Nov. 30, 2018, 9:27 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
512000 |
|
2700 |
39739689 |
.I. |
C |
June 28, 2018, 10:24 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
1228800 |
|
2700 |
64614940 |
hjk1030 |
C |
Nov. 10, 2019, 4:14 a.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
1638400 |
|
2700 |
50894386 |
vjudge1 |
C |
March 6, 2019, 2:25 p.m. |
OK |
GNU C++17 |
TESTS |
64 |
31 |
2560000 |
|
2700 |
28053802 |
IgorKoval |
C |
June 26, 2017, 9:12 a.m. |
OK |
Java 8 |
TESTS |
64 |
140 |
20582400 |
|
2700 |
remove filters
Back to search problems