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"Monocarp is playing a computer game. In this game, his character fights different monsters. A fight between a character and a monster goes as follows. Suppose the character initially has health h_C and attack d_C ; the monster initially has health h_M and attack d_M . The fight consists of several steps: The fight ends when someone's health becomes non-positive (i. xe2 x80 x89e. 0 or less). If the monster's health becomes non-positive, the character wins, otherwise the monster wins. Monocarp's character currently has health equal to h_C and attack equal to d_C . He wants to slay a monster with health equal to h_M and attack equal to d_M . Before the fight, Monocarp can spend up to k coins to upgrade his character's weapon and/or armor; each upgrade costs exactly one coin, each weapon upgrade increases the character's attack by w , and each armor upgrade increases the character's health by a . Can Monocarp's character slay the monster if Monocarp spends coins on upgrades optimally? The first line contains one integer t ( 1 <= t <= 5 cdot 10^4 ) -- the number of test cases. Each test case consists of three lines: The first line contains two integers h_C and d_C ( 1 <= h_C <= 10^{15} ; 1 <= d_C <= 10^9 ) -- the character's health and attack; The second line contains two integers h_M and d_M ( 1 <= h_M <= 10^{15} ; 1 <= d_M <= 10^9 ) -- the monster's health and attack; The third line contains three integers k , w and a ( 0 <= k <= 2 cdot 10^5 ; 0 <= w <= 10^4 ; 0 <= a <= 10^{10} ) -- the maximum number of coins that Monocarp can spend, the amount added to the character's attack with each weapon upgrade, and the amount added to the character's health with each armor upgrade, respectively. The sum of k over all test cases does not exceed 2 cdot 10^5 . For each test case, print YES if it is p"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
144781630 |
cyrus_msk |
C |
Jan. 31, 2022, 8:58 p.m. |
OK |
D |
TESTS |
42 |
108 |
2150400 |
|
|
144781716 |
cyrus_msk |
C |
Jan. 31, 2022, 9 p.m. |
OK |
D |
TESTS |
42 |
108 |
2150400 |
|
|
144780425 |
1435730 |
C |
Jan. 31, 2022, 8:32 p.m. |
OK |
GNU C11 |
TESTS |
42 |
31 |
0 |
|
|
144783745 |
tanisha_daharwal |
C |
Jan. 31, 2022, 9:52 p.m. |
OK |
GNU C11 |
TESTS |
42 |
233 |
0 |
|
|
144794896 |
sandbad |
C |
Feb. 1, 2022, 4:39 a.m. |
OK |
GNU C11 |
TESTS |
42 |
233 |
0 |
|
|
144767124 |
FlamingCoriander |
C |
Jan. 31, 2022, 5:45 p.m. |
OK |
GNU C11 |
TESTS |
42 |
234 |
0 |
|
|
144770802 |
vishveswarch710 |
C |
Jan. 31, 2022, 6:18 p.m. |
OK |
GNU C11 |
TESTS |
42 |
234 |
0 |
|
|
144761443 |
rahulshukla_12 |
C |
Jan. 31, 2022, 5:05 p.m. |
OK |
GNU C11 |
TESTS |
42 |
234 |
0 |
|
|
144796073 |
Pawan_Lahoti |
C |
Feb. 1, 2022, 5:08 a.m. |
OK |
GNU C11 |
TESTS |
42 |
249 |
0 |
|
|
144763105 |
Adityak2507 |
C |
Jan. 31, 2022, 5:15 p.m. |
OK |
GNU C11 |
TESTS |
42 |
249 |
0 |
|
|
144763270 |
Sankalp_12 |
C |
Jan. 31, 2022, 5:16 p.m. |
OK |
GNU C11 |
TESTS |
42 |
249 |
0 |
|
|
144761458 |
SkyWolfy |
C |
Jan. 31, 2022, 5:05 p.m. |
OK |
GNU C11 |
TESTS |
42 |
249 |
3686400 |
|
|
144786780 |
ahwhQZY20080812 |
C |
Feb. 1, 2022, 12:44 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
31 |
0 |
|
|
144770773 |
vishveswarch710 |
C |
Jan. 31, 2022, 6:18 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
31 |
0 |
|
|
144781700 |
chanoey |
C |
Jan. 31, 2022, 9 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
31 |
0 |
|
|
144794293 |
ACOIer |
C |
Feb. 1, 2022, 4:30 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
31 |
0 |
|
|
144778566 |
wushi555 |
C |
Jan. 31, 2022, 7:59 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
31 |
819200 |
|
|
144799476 |
songziyan |
C |
Feb. 1, 2022, 6 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
0 |
|
|
144798220 |
blade_dance |
C |
Feb. 1, 2022, 5:46 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
0 |
|
|
144792772 |
keep1earning |
C |
Feb. 1, 2022, 4:04 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
0 |
|
|
144791440 |
Indigosky |
C |
Feb. 1, 2022, 3:36 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
0 |
|
|
144791273 |
Iratis |
C |
Feb. 1, 2022, 3:32 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
46 |
0 |
|
|
144785921 |
Kilani |
C |
Jan. 31, 2022, 11:54 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
31 |
0 |
|
|
144787050 |
harvey_wzy |
C |
Feb. 1, 2022, 1:02 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
31 |
0 |
|
|
144790851 |
Wecther115 |
C |
Feb. 1, 2022, 3:23 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144791725 |
HHU_fl |
C |
Feb. 1, 2022, 3:43 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144792130 |
Batool_2525 |
C |
Feb. 1, 2022, 3:50 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144793497 |
acwing_gza |
C |
Feb. 1, 2022, 4:16 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144794368 |
kybergur |
C |
Feb. 1, 2022, 4:31 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144794792 |
bear203 |
C |
Feb. 1, 2022, 4:38 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144790334 |
Tynoo |
C |
Feb. 1, 2022, 3:11 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144790103 |
wangyifei13134 |
C |
Feb. 1, 2022, 3:04 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
46 |
0 |
|
|
144797770 |
Weierstrass |
C |
Feb. 1, 2022, 5:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
15 |
0 |
|
|
144790405 |
Yzikey |
C |
Feb. 1, 2022, 3:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
30 |
0 |
|
|
144770846 |
vishveswarch710 |
C |
Jan. 31, 2022, 6:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
30 |
0 |
|
|
144758587 |
Ray_Striker |
C |
Jan. 31, 2022, 4:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
30 |
0 |
|
|
144794577 |
adityasonani |
C |
Feb. 1, 2022, 4:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
30 |
0 |
|
|
144798525 |
Continued_Story |
C |
Feb. 1, 2022, 5:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
31 |
0 |
|
|
144795211 |
Emotiona |
C |
Feb. 1, 2022, 4:46 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
31 |
0 |
|
|
144793263 |
xyf007 |
C |
Feb. 1, 2022, 4:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
31 |
0 |
|
|
144788803 |
QuartZ_Z |
C |
Feb. 1, 2022, 2:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
31 |
0 |
|
|
144787798 |
Richw818 |
C |
Feb. 1, 2022, 1:42 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
31 |
0 |
|
|
144771284 |
namang01 |
C |
Jan. 31, 2022, 6:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
15 |
0 |
|
|
144788825 |
gllonkxc |
C |
Feb. 1, 2022, 2:26 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
15 |
0 |
|
|
144788789 |
zhangyi02 |
C |
Feb. 1, 2022, 2:24 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
15 |
102400 |
|
|
144793506 |
sakshamian |
C |
Feb. 1, 2022, 4:16 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
15 |
204800 |
|
|
144776437 |
Amrharb |
C |
Jan. 31, 2022, 7:27 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
30 |
0 |
|
|
144777437 |
acfinity |
C |
Jan. 31, 2022, 7:41 p.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
30 |
0 |
|
|
144798097 |
kyon2326 |
C |
Feb. 1, 2022, 5:44 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
31 |
0 |
|
|
144799188 |
sugam10 |
C |
Feb. 1, 2022, 5:57 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
31 |
0 |
|
|
144799426 |
Nakamiya |
C |
Feb. 1, 2022, 5:59 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
31 |
0 |
|
|
144799631 |
Gornak40 |
C |
Feb. 1, 2022, 6:01 a.m. |
OK |
GNU C++20 (64) |
TESTS |
42 |
31 |
0 |
|
|
144769987 |
Dmohan |
C |
Jan. 31, 2022, 6:10 p.m. |
OK |
Go |
TESTS |
42 |
156 |
3072000 |
|
|
144778387 |
koqo |
C |
Jan. 31, 2022, 7:56 p.m. |
OK |
Go |
TESTS |
42 |
156 |
4300800 |
|
|
144773293 |
glebsamsonov |
C |
Jan. 31, 2022, 6:45 p.m. |
OK |
Go |
TESTS |
42 |
295 |
1126400 |
|
|
144788123 |
robinz62 |
C |
Feb. 1, 2022, 1:56 a.m. |
OK |
Java 11 |
TESTS |
42 |
187 |
0 |
|
|
144773785 |
vijender_8601 |
C |
Jan. 31, 2022, 6:51 p.m. |
OK |
Java 11 |
TESTS |
42 |
202 |
0 |
|
|
144798134 |
Satyaa |
C |
Feb. 1, 2022, 5:45 a.m. |
OK |
Java 11 |
TESTS |
42 |
202 |
0 |
|
|
144760922 |
BhargavModha |
C |
Jan. 31, 2022, 5:02 p.m. |
OK |
Java 11 |
TESTS |
42 |
202 |
0 |
|
|
144758776 |
SaberXpro |
C |
Jan. 31, 2022, 4:51 p.m. |
OK |
Java 11 |
TESTS |
42 |
202 |
0 |
|
|
144767254 |
Vaishnavi_Sahu |
C |
Jan. 31, 2022, 5:46 p.m. |
OK |
Java 11 |
TESTS |
42 |
217 |
0 |
|
|
144791925 |
unfixedbug |
C |
Feb. 1, 2022, 3:47 a.m. |
OK |
Java 11 |
TESTS |
42 |
217 |
0 |
|
|
144799401 |
the_unseen |
C |
Feb. 1, 2022, 5:59 a.m. |
OK |
Java 11 |
TESTS |
42 |
218 |
0 |
|
|
144798000 |
__Serendipity |
C |
Feb. 1, 2022, 5:43 a.m. |
OK |
Java 11 |
TESTS |
42 |
218 |
0 |
|
|
144790906 |
Satyaa |
C |
Feb. 1, 2022, 3:24 a.m. |
OK |
Java 11 |
TESTS |
42 |
218 |
0 |
|
|
144763574 |
themadknight45 |
C |
Jan. 31, 2022, 5:18 p.m. |
OK |
Java 8 |
TESTS |
42 |
139 |
0 |
|
|
144798023 |
NerfThis |
C |
Feb. 1, 2022, 5:44 a.m. |
OK |
Java 8 |
TESTS |
42 |
139 |
0 |
|
|
144791060 |
tushar24 |
C |
Feb. 1, 2022, 3:27 a.m. |
OK |
Java 8 |
TESTS |
42 |
140 |
0 |
|
|
144769816 |
Mohamed308 |
C |
Jan. 31, 2022, 6:09 p.m. |
OK |
Java 8 |
TESTS |
42 |
140 |
0 |
|
|
144769983 |
AggravatedCow |
C |
Jan. 31, 2022, 6:10 p.m. |
OK |
Java 8 |
TESTS |
42 |
170 |
0 |
|
|
144770500 |
rsingh3_be18 |
C |
Jan. 31, 2022, 6:15 p.m. |
OK |
Java 8 |
TESTS |
42 |
170 |
0 |
|
|
144767922 |
Karakurik |
C |
Jan. 31, 2022, 5:52 p.m. |
OK |
Java 8 |
TESTS |
42 |
170 |
0 |
|
|
144793300 |
less_ordinary |
C |
Feb. 1, 2022, 4:13 a.m. |
OK |
Java 8 |
TESTS |
42 |
171 |
0 |
|
|
144772538 |
NatInTheHat |
C |
Jan. 31, 2022, 6:36 p.m. |
OK |
Java 8 |
TESTS |
42 |
171 |
0 |
|
|
144763193 |
getxy |
C |
Jan. 31, 2022, 5:16 p.m. |
OK |
Java 8 |
TESTS |
42 |
186 |
0 |
|
|
144768821 |
arvindf232 |
C |
Jan. 31, 2022, 6 p.m. |
OK |
Kotlin 1.4 |
TESTS |
42 |
124 |
0 |
|
|
144770910 |
vishveswarch710 |
C |
Jan. 31, 2022, 6:19 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
77 |
0 |
|
|
144766800 |
Tanish69 |
C |
Jan. 31, 2022, 5:42 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
187 |
0 |
|
|
144756808 |
Arman06 |
C |
Jan. 31, 2022, 4:43 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
358 |
0 |
|
|
144774888 |
pyromania_99 |
C |
Jan. 31, 2022, 7:06 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
389 |
0 |
|
|
144789512 |
_Rimjhim_36 |
C |
Feb. 1, 2022, 2:48 a.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
390 |
0 |
|
|
144785864 |
CosmoRied |
C |
Jan. 31, 2022, 11:52 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
390 |
0 |
|
|
144789674 |
_Rimjhim_36 |
C |
Feb. 1, 2022, 2:53 a.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
404 |
0 |
|
|
144789352 |
thapamuskan771 |
C |
Feb. 1, 2022, 2:44 a.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
405 |
0 |
|
|
144769623 |
suraj |
C |
Jan. 31, 2022, 6:07 p.m. |
OK |
.NET Core C# |
TESTS |
42 |
249 |
3379200 |
|
|
144757656 |
1_2_3_4_5_9 |
C |
Jan. 31, 2022, 4:47 p.m. |
OK |
PyPy 2 |
TESTS |
42 |
171 |
5222400 |
|
|
144785807 |
FlakeLCR |
C |
Jan. 31, 2022, 11:47 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
171 |
7372800 |
|
|
144760383 |
Austin231 |
C |
Jan. 31, 2022, 4:59 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
233 |
8192000 |
|
|
144771755 |
abhishekk_7 |
C |
Jan. 31, 2022, 6:27 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
264 |
7372800 |
|
|
144792823 |
__J__ |
C |
Feb. 1, 2022, 4:05 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
265 |
7065600 |
|
|
144769866 |
qwembe |
C |
Jan. 31, 2022, 6:09 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
342 |
9523200 |
|
|
144798036 |
aman404found |
C |
Feb. 1, 2022, 5:44 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
358 |
9523200 |
|
|
144797376 |
majay1638 |
C |
Feb. 1, 2022, 5:36 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
358 |
9523200 |
|
|
144792314 |
whatshisbucket |
C |
Feb. 1, 2022, 3:54 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
389 |
10547200 |
|
|
144761614 |
Bad_day_toCode |
C |
Jan. 31, 2022, 5:06 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
451 |
19353600 |
|
|
144778974 |
vstatarenko |
C |
Jan. 31, 2022, 8:06 p.m. |
OK |
PyPy 3 |
TESTS |
42 |
467 |
9523200 |
|
|
144765974 |
mayank35 |
C |
Jan. 31, 2022, 5:35 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
187 |
9216000 |
|
|
144768659 |
nitish420 |
C |
Jan. 31, 2022, 5:58 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
202 |
10035200 |
|
|
144774161 |
gourav2001k |
C |
Jan. 31, 2022, 6:56 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
280 |
11571200 |
|
|
144760788 |
kaustavshouvik |
C |
Jan. 31, 2022, 5:01 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
327 |
10137600 |
|
|
144758237 |
sarthak_bharadwaj_ |
C |
Jan. 31, 2022, 4:49 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
327 |
14540800 |
|
|
144792366 |
chetanpatel003 |
C |
Feb. 1, 2022, 3:55 a.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
342 |
10752000 |
|
|
144769357 |
del-user-774348 |
C |
Jan. 31, 2022, 6:05 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
373 |
10444800 |
|
|
144789624 |
rajeshpenugonda6 |
C |
Feb. 1, 2022, 2:51 a.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
467 |
18124800 |
|
|
144770928 |
furmarie |
C |
Jan. 31, 2022, 6:19 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
670 |
14131200 |
|
|
144770309 |
uroborosikes |
C |
Jan. 31, 2022, 6:13 p.m. |
OK |
PyPy 3-64 |
TESTS |
42 |
1247 |
12288000 |
|
|
144768615 |
hwei002 |
C |
Jan. 31, 2022, 5:58 p.m. |
OK |
Python 3 |
TESTS |
42 |
327 |
409600 |
|
|
144757861 |
Abhi_khurana |
C |
Jan. 31, 2022, 4:47 p.m. |
OK |
Python 3 |
TESTS |
42 |
498 |
409600 |
|
|
144783392 |
ervin5 |
C |
Jan. 31, 2022, 9:41 p.m. |
OK |
Python 3 |
TESTS |
42 |
561 |
307200 |
|
|
144783261 |
ervin5 |
C |
Jan. 31, 2022, 9:37 p.m. |
OK |
Python 3 |
TESTS |
42 |
561 |
307200 |
|
|
144798269 |
The_Samurai |
C |
Feb. 1, 2022, 5:46 a.m. |
OK |
Python 3 |
TESTS |
42 |
670 |
0 |
|
|
144784504 |
ddx01 |
C |
Jan. 31, 2022, 10:18 p.m. |
OK |
Python 3 |
TESTS |
42 |
670 |
0 |
|
|
144772857 |
namandamani3112 |
C |
Jan. 31, 2022, 6:40 p.m. |
OK |
Python 3 |
TESTS |
42 |
670 |
0 |
|
|
144757200 |
av_3000 |
C |
Jan. 31, 2022, 4:45 p.m. |
OK |
Python 3 |
TESTS |
42 |
685 |
0 |
|
|
144770974 |
nishithm |
C |
Jan. 31, 2022, 6:20 p.m. |
OK |
Python 3 |
TESTS |
42 |
686 |
0 |
|
|
144784301 |
kamtendra_20 |
C |
Jan. 31, 2022, 10:11 p.m. |
OK |
Python 3 |
TESTS |
42 |
686 |
0 |
|
|
remove filters
Back to search problems