Please help me with this not able to find anything after days of thought

Правка en9, от Sachit_Jaggi, 2020-01-26 22:44:21

question Educational Codeforces Round 76 (Rated for Div. 2) D-Yet Another Monster Killing Problem

my submission 69496905

I am not able to understand which test case is failing any testcase would be highly helpful ..

I have put the following conditions *if maximum power of hero is less than maximum power of monsters then directly print -1 and exit

*else answer exists we iterate throughout and we create the bst array which is as described in the editorial.Using which we check the 2 conditions :-

--->if maximum in a our range is greater than our hero's power then we break and add a count to our days

--->if we have reached the hero with highest endurance and have exhausted him too then we again break and add a count to our days

I believe this covers all the possibilities ..

please help me .

Thanks in Advance

EDIT -- Now it is working

GUYS IT IS NOW WORKING THE ERROR WAS THAT I HAD INCREMENTED THE INDEX OF HEROES ONLY BY 1 EACH TIME WHICH DID NOT COVER ALL THE CASES. I HAD TO INCREMENT THE INDEX OF HEROES TILL I FOUND ONE WITH HIGHER ENDURANCE.

THANKS A LOT EVERYONE FOR YOUR REPLIES.

NEW SUBMISSION -- WORKING

OLD SUBMISSION

I HAVE UPLOADED THE CHANGES YOU CAN SEE

Теги greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en9 Английский Sachit_Jaggi 2020-01-26 22:44:21 26 Tiny change: 'ce\n\n\n\nEDIT \nGUYS IT ' -> 'ce\n\n\n\n**EDIT -- Now it is working**\n\nGUYS IT '
en8 Английский Sachit_Jaggi 2020-01-26 22:03:45 2 Initial revision
en7 Английский Sachit_Jaggi 2020-01-26 22:00:12 481
en6 Английский Sachit_Jaggi 2020-01-25 10:28:03 9 Tiny change: 'submission](https://' -> 'submission 69496905](https://'
en5 Английский Sachit_Jaggi 2020-01-25 10:27:27 93
en4 Английский Sachit_Jaggi 2020-01-25 10:09:42 0 (published)
en3 Английский Sachit_Jaggi 2020-01-25 09:31:47 6 (saved to drafts)
en2 Английский Sachit_Jaggi 2020-01-25 09:31:21 43
en1 Английский Sachit_Jaggi 2020-01-25 09:30:02 936 Initial revision (published)