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'Sparkle gives you two arrays a and b of length n . Initially, your score is 0 . In one operation, you can choose an integer i and add a_i to your score. Then, you must set a_i = max(0, a_i - b_i) . You only have time to perform k operations before Sparkle sets off a nuclear bomb! What is the maximum score you can acquire after k operations? The first line contains t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains n and k ( 1 <= q n <= q 2 cdot 10^5, 1 <= q k <= q 10^9 ) -- the length of the arrays and the number of operations you can perform. The following line contains n integers a_1, a_2, ... a_n ( 1 <= q a_i <= q 10^9 ). The following line contains n integers b_1, b_2, ... b_n ( 1 <= q b_i <= q 10^9 ). It is guaranteed that the sum of n for all test cases does not exceed 2 cdot 10^5 . For each test case, output an integer, the maximum score you can acquire after k operations. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
272878301 |
A1ternate |
F |
July 26, 2024, 10:04 p.m. |
OK |
C# 10 |
TESTS |
15 |
234 |
53657600 |
|
|
272872664 |
A1ternate |
F |
July 26, 2024, 8:32 p.m. |
OK |
C# 10 |
TESTS |
15 |
249 |
53657600 |
|
|
272866553 |
nemars |
F |
July 26, 2024, 7:15 p.m. |
OK |
C# 10 |
TESTS |
15 |
1093 |
23552000 |
|
|
272889690 |
SunnyYuan2009 |
F |
July 27, 2024, 2:04 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
140 |
1638400 |
|
|
272855674 |
Lilinta |
F |
July 26, 2024, 5:44 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
156 |
3276800 |
|
|
272870803 |
CoderVinit |
F |
July 26, 2024, 8:07 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
171 |
0 |
|
|
272856975 |
Pranjal_Singh_1702 |
F |
July 26, 2024, 5:53 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
171 |
0 |
|
|
272888233 |
ryhhh |
F |
July 27, 2024, 1:47 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
171 |
3276800 |
|
|
272902641 |
akasaudhan |
F |
July 27, 2024, 4:31 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
171 |
16384000 |
|
|
272901319 |
CM_This_Year |
F |
July 27, 2024, 4:16 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
186 |
0 |
|
|
272891693 |
bkl_1010 |
F |
July 27, 2024, 2:29 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
187 |
3174400 |
|
|
272890149 |
ilija_IR_13 |
F |
July 27, 2024, 2:11 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
203 |
3276800 |
|
|
272898023 |
lcf12345 |
F |
July 27, 2024, 3:40 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
15 |
217 |
3276800 |
|
|
272896013 |
tranducbo |
F |
July 27, 2024, 3:18 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
124 |
0 |
|
|
272870523 |
nitro_a_grade |
F |
July 26, 2024, 8:03 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
140 |
1638400 |
|
|
272904049 |
freakin23 |
F |
July 27, 2024, 4:46 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
140 |
7987200 |
|
|
272892539 |
LETTERA |
F |
July 27, 2024, 2:40 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
0 |
|
|
272884362 |
happydreamer |
F |
July 27, 2024, 12:29 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
0 |
|
|
272859294 |
acfmidinsw |
F |
July 26, 2024, 6:09 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
0 |
|
|
272888709 |
SriniV |
F |
July 27, 2024, 1:53 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
1638400 |
|
|
272888472 |
SriniV |
F |
July 27, 2024, 1:50 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
1638400 |
|
|
272885002 |
Rororna |
F |
July 27, 2024, 12:44 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
155 |
5836800 |
|
|
272885298 |
Konggee. |
F |
July 27, 2024, 12:51 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
15 |
156 |
0 |
|
|
272858343 |
UltramanDecker |
F |
July 26, 2024, 6:03 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
77 |
102400 |
|
|
272900861 |
emptymind |
F |
July 27, 2024, 4:11 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
108 |
0 |
|
|
272905759 |
zzh.free |
F |
July 27, 2024, 5:03 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272900411 |
LNian |
F |
July 27, 2024, 4:05 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272899490 |
emptymind |
F |
July 27, 2024, 3:55 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272889956 |
biank |
F |
July 27, 2024, 2:08 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272882944 |
itzzRaghav |
F |
July 26, 2024, 11:53 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272881162 |
Xx_star |
F |
July 26, 2024, 11:07 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272879132 |
Xx_star |
F |
July 26, 2024, 10:20 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272876592 |
JhoZzel_ |
F |
July 26, 2024, 9:34 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
15 |
109 |
0 |
|
|
272873317 |
KinDeR___ |
F |
July 26, 2024, 8:41 p.m. |
OK |
Go |
TESTS |
15 |
249 |
7782400 |
|
|
272874955 |
susvant |
F |
July 26, 2024, 9:06 p.m. |
OK |
Java 21 |
TESTS |
15 |
359 |
716800 |
|
|
272883438 |
gdax |
F |
July 27, 2024, 12:07 a.m. |
OK |
Java 21 |
TESTS |
15 |
390 |
5017600 |
|
|
272867567 |
vinay_panwar |
F |
July 26, 2024, 7:27 p.m. |
OK |
Java 21 |
TESTS |
15 |
405 |
9830400 |
|
|
272869658 |
ziad-abdou1 |
F |
July 26, 2024, 7:52 p.m. |
OK |
Java 21 |
TESTS |
15 |
437 |
8704000 |
|
|
272899951 |
testtest111ksjfrdvn |
F |
July 27, 2024, 4 a.m. |
OK |
Java 21 |
TESTS |
15 |
514 |
10649600 |
|
|
272885094 |
sagbis |
F |
July 27, 2024, 12:46 a.m. |
OK |
Java 21 |
TESTS |
15 |
546 |
10342400 |
|
|
272849759 |
dzhi |
F |
July 26, 2024, 5:04 p.m. |
OK |
Java 21 |
TESTS |
15 |
577 |
8704000 |
|
|
272867314 |
Baski_Flex |
F |
July 26, 2024, 7:24 p.m. |
OK |
Java 21 |
TESTS |
15 |
1015 |
1331200 |
|
|
272900910 |
saltyNoodles |
F |
July 27, 2024, 4:11 a.m. |
OK |
Java 21 |
TESTS |
15 |
1030 |
1126400 |
|
|
272908606 |
himanshupareekiit01 |
F |
July 27, 2024, 5:29 a.m. |
OK |
Java 21 |
TESTS |
15 |
1046 |
1024000 |
|
|
272881313 |
Sumitsingh7 |
F |
July 26, 2024, 11:11 p.m. |
OK |
Java 8 |
TESTS |
15 |
249 |
6553600 |
|
|
272882599 |
CipherSphinx_Raj |
F |
July 26, 2024, 11:44 p.m. |
OK |
Java 8 |
TESTS |
15 |
296 |
39219200 |
|
|
272882588 |
__runknowna__ |
F |
July 26, 2024, 11:44 p.m. |
OK |
Java 8 |
TESTS |
15 |
296 |
39219200 |
|
|
272891215 |
Yousef_Badr |
F |
July 27, 2024, 2:23 a.m. |
OK |
Java 8 |
TESTS |
15 |
343 |
18227200 |
|
|
272891159 |
faresbadr316 |
F |
July 27, 2024, 2:23 a.m. |
OK |
Java 8 |
TESTS |
15 |
343 |
18227200 |
|
|
272890704 |
faresbadr316 |
F |
July 27, 2024, 2:17 a.m. |
OK |
Java 8 |
TESTS |
15 |
343 |
18227200 |
|
|
272907635 |
aditya888 |
F |
July 27, 2024, 5:20 a.m. |
OK |
Java 8 |
TESTS |
15 |
405 |
21401600 |
|
|
272890411 |
faresbadr316 |
F |
July 27, 2024, 2:14 a.m. |
OK |
Java 8 |
TESTS |
15 |
421 |
18227200 |
|
|
272881395 |
white___devil |
F |
July 26, 2024, 11:13 p.m. |
OK |
Java 8 |
TESTS |
15 |
889 |
5324800 |
|
|
272909118 |
valueNone |
F |
July 27, 2024, 5:33 a.m. |
OK |
PyPy 3 |
TESTS |
15 |
546 |
19558400 |
|
|
272853209 |
shilpabanerjee50 |
F |
July 26, 2024, 5:31 p.m. |
OK |
PyPy 3 |
TESTS |
15 |
609 |
22425600 |
|
|
272870836 |
Kingbubs |
F |
July 26, 2024, 8:08 p.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
265 |
34508800 |
|
|
272876703 |
kkkk1234 |
F |
July 26, 2024, 9:36 p.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
265 |
38502400 |
|
|
272873060 |
KAMITO |
F |
July 26, 2024, 8:37 p.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
265 |
40038400 |
|
|
272905308 |
kamitocxy |
F |
July 27, 2024, 4:59 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
281 |
40038400 |
|
|
272908035 |
alexwice |
F |
July 27, 2024, 5:24 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
281 |
48947200 |
|
|
272883638 |
pierrot |
F |
July 27, 2024, 12:12 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
311 |
37478400 |
|
|
272895785 |
Sunlight |
F |
July 27, 2024, 3:15 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
327 |
38502400 |
|
|
272877514 |
jvatsal0709 |
F |
July 26, 2024, 9:50 p.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
327 |
38502400 |
|
|
272871422 |
RobinFromTheHood |
F |
July 26, 2024, 8:15 p.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
327 |
38502400 |
|
|
272885200 |
lucasschnee |
F |
July 27, 2024, 12:49 a.m. |
OK |
PyPy 3-64 |
TESTS |
15 |
327 |
39014400 |
|
|
272877450 |
DeanMMenezes |
F |
July 26, 2024, 9:49 p.m. |
OK |
Rust 2021 |
TESTS |
15 |
78 |
8499200 |
|
|
272852101 |
n685 |
F |
July 26, 2024, 5:26 p.m. |
OK |
Rust 2021 |
TESTS |
15 |
92 |
5836800 |
|
|
272859926 |
Cheshulko |
F |
July 26, 2024, 6:14 p.m. |
OK |
Rust 2021 |
TESTS |
15 |
171 |
16896000 |
|
|
remove filters
Back to search problems