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"Roma is playing a new expansion for his favorite game World of Darkraft. He made a new character and is going for his first grind. Roma has a choice to buy exactly one of n different weapons and exactly one of m different armor sets. Weapon i has attack modifier a_i and is worth ca_i coins, and armor set j has defense modifier b_j and is worth cb_j coins. After choosing his equipment Roma can proceed to defeat some monsters. There are p monsters he can try to defeat. Monster k has defense x_k , attack y_k and possesses z_k coins. Roma can defeat a monster if his weapon's attack modifier is larger than the monster's defense, and his armor set's defense modifier is larger than the monster's attack. That is, a monster k can be defeated with a weapon i and an armor set j if a_i > x_k and b_j > y_k . After defeating the monster, Roma takes all the coins from them. During the grind, Roma can defeat as many monsters as he likes. Monsters do not respawn, thus each monster can be defeated at most one. Thanks to Roma's excessive donations, we can assume that he has an infinite amount of in-game currency and can afford any of the weapons and armor sets. Still, he wants to maximize the profit of the grind. The profit is defined as the total coins obtained from all defeated monsters minus the cost of his equipment. Note that Roma must purchase a weapon and an armor set even if he can not cover their cost with obtained coins. Help Roma find the maximum profit of the grind. The first line contains three integers n , m , and p ( 1 <= q n, m, p <= q 2 cdot 10^5 ) -- the number of available weapons, armor sets and monsters respectively. The following n lines describe available weapons. The i -th of these lines contains two integers a_i and ca_i ( 1 <= q a_i <= q 10^6 , 1 <= q ca_i <= q 10^9 ) -- the attack modifie"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
72198522 |
hos.lyric |
C |
March 1, 2020, 2:59 p.m. |
OK |
D |
TESTS |
20 |
1122 |
103628800 |
|
|
72190063 |
physics0523 |
C |
March 1, 2020, 2:24 p.m. |
OK |
GNU C11 |
TESTS |
20 |
919 |
54579200 |
|
|
72184919 |
Fuyuki |
C |
March 1, 2020, 2:05 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
156 |
34201600 |
|
|
72184910 |
CYJian |
C |
March 1, 2020, 2:05 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
171 |
12288000 |
|
|
72202632 |
Famvics |
C |
March 1, 2020, 3:14 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
187 |
11980800 |
|
|
72202456 |
zhumingyang |
C |
March 1, 2020, 3:14 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
187 |
12083200 |
|
|
72185285 |
hanyuwei |
C |
March 1, 2020, 2:07 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
187 |
12697600 |
|
|
72190022 |
Juanzhang |
C |
March 1, 2020, 2:24 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
187 |
12800000 |
|
|
72194099 |
dysyn1314 |
C |
March 1, 2020, 2:40 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
187 |
25907200 |
|
|
72187611 |
dfcmd |
C |
March 1, 2020, 2:15 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
202 |
72089600 |
|
|
72184206 |
msuwakow |
C |
March 1, 2020, 2:03 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
218 |
20172800 |
|
|
72188982 |
11235813213455 |
C |
March 1, 2020, 2:20 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
233 |
14643200 |
|
|
72186899 |
tokitsukaze |
C |
March 1, 2020, 2:12 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
249 |
83865600 |
|
|
72180213 |
idxcalcal |
C |
March 1, 2020, 1:50 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
265 |
70041600 |
|
|
72174946 |
QAQAutoMaton |
C |
March 1, 2020, 1:36 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
295 |
36454400 |
|
|
72187153 |
jakedavis |
C |
March 1, 2020, 2:13 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
373 |
25702400 |
|
|
72207785 |
ZZZZZZZZZZZZZZZZZZ |
C |
March 1, 2020, 5:17 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
373 |
38502400 |
|
|
72183415 |
LanrTabe |
C |
March 1, 2020, 2 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
374 |
12800000 |
|
|
72177948 |
jijiang |
C |
March 1, 2020, 1:43 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
374 |
63078400 |
|
|
72184708 |
Linkus |
C |
March 1, 2020, 2:05 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
389 |
36761600 |
|
|
72197123 |
sarkar |
C |
March 1, 2020, 2:53 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
390 |
13312000 |
|
|
72191851 |
espr1t |
C |
March 1, 2020, 2:31 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
404 |
39219200 |
|
|
72182564 |
saketh |
C |
March 1, 2020, 1:58 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
265 |
20992000 |
|
|
72202404 |
Qingyu |
C |
March 1, 2020, 3:14 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
295 |
28262400 |
|
|
72194478 |
Nlygayatb |
C |
March 1, 2020, 2:42 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
373 |
77721600 |
|
|
72208256 |
ngtkana |
C |
March 1, 2020, 5:26 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
374 |
17203200 |
|
|
72188811 |
badcw |
C |
March 1, 2020, 2:19 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
389 |
13619200 |
|
|
72197335 |
Max.D. |
C |
March 1, 2020, 2:54 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
389 |
14028800 |
|
|
72196195 |
libra9z |
C |
March 1, 2020, 2:49 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
389 |
25702400 |
|
|
72205159 |
Z3L5M |
C |
March 1, 2020, 4:36 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
390 |
13619200 |
|
|
72194867 |
natsugiri |
C |
March 1, 2020, 2:43 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
405 |
12595200 |
|
|
72184029 |
__JuRuo |
C |
March 1, 2020, 2:02 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
405 |
54681600 |
|
|
72184728 |
uwi |
C |
March 1, 2020, 2:05 p.m. |
OK |
Java 11 |
TESTS |
20 |
701 |
32563200 |
|
|
72184170 |
Suzukaze |
C |
March 1, 2020, 2:03 p.m. |
OK |
Java 11 |
TESTS |
20 |
967 |
43827200 |
|
|
72197630 |
ZeyadKhattab |
C |
March 1, 2020, 2:55 p.m. |
OK |
Java 11 |
TESTS |
20 |
982 |
41574400 |
|
|
72186094 |
mikit |
C |
March 1, 2020, 2:09 p.m. |
OK |
Java 11 |
TESTS |
20 |
1528 |
64307200 |
|
|
72198372 |
cwise |
C |
March 1, 2020, 2:58 p.m. |
OK |
Java 8 |
TESTS |
20 |
763 |
50380800 |
|
|
72196815 |
BaZ_ |
C |
March 1, 2020, 2:51 p.m. |
OK |
Java 8 |
TESTS |
20 |
779 |
27648000 |
|
|
72215102 |
ijxjdjd |
C |
March 1, 2020, 7:55 p.m. |
OK |
Java 8 |
TESTS |
20 |
1044 |
99942400 |
|
|
72193362 |
iakovlev.zakhar |
C |
March 1, 2020, 2:37 p.m. |
OK |
Java 8 |
TESTS |
20 |
1091 |
29388800 |
|
|
72195150 |
SecondThread |
C |
March 1, 2020, 2:44 p.m. |
OK |
Java 8 |
TESTS |
20 |
1247 |
144691200 |
|
|
72197135 |
VArtem |
C |
March 1, 2020, 2:53 p.m. |
OK |
Java 8 |
TESTS |
20 |
1372 |
44851200 |
|
|
72209368 |
yakamoto |
C |
March 1, 2020, 5:51 p.m. |
OK |
Kotlin |
TESTS |
20 |
1122 |
67174400 |
|
|
72182840 |
Tlatoani |
C |
March 1, 2020, 1:59 p.m. |
OK |
Kotlin |
TESTS |
20 |
1840 |
82227200 |
|
|
72206954 |
elizarov |
C |
March 1, 2020, 5:02 p.m. |
OK |
Kotlin |
TESTS |
20 |
1965 |
112537600 |
|
|
72193016 |
keymoon |
C |
March 1, 2020, 2:35 p.m. |
OK |
Mono C# |
TESTS |
20 |
1575 |
57446400 |
|
|
72197874 |
math957963 |
C |
March 1, 2020, 2:56 p.m. |
OK |
MS C++ |
TESTS |
20 |
452 |
25292800 |
|
|
72208666 |
pichulia |
C |
March 1, 2020, 5:35 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
576 |
28876800 |
|
|
72192114 |
Friska |
C |
March 1, 2020, 2:32 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
1387 |
73728000 |
|
|
72214171 |
titia |
C |
March 1, 2020, 7:33 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
1918 |
131174400 |
|
|
72213827 |
titia |
C |
March 1, 2020, 7:25 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
1965 |
130355200 |
|
|
72184587 |
sansen |
C |
March 1, 2020, 2:04 p.m. |
OK |
Rust |
TESTS |
20 |
639 |
64819200 |
|
|
remove filters
Back to search problems