ahmadexe's blog

By ahmadexe, history, 2 months ago, In English

Please tell me what's going on here imma lose my stuff https://mirror.codeforces.com/contest/2192/submission/366483077

I'm handling the first case where the sum of the array perfectly divides the health. (h % sum == 0) Here the output is n * (h/sum) + k * (h/sum — 1). Since no need to reload once you've gone through the array For the second case, I'm maintaining a minimum value and checking if I replace that value with max from the suffix.

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Ummm... I think you got the wrong submission

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ahmadexe (previous revision, new revision, compare).

»
2 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

i stress tested your code and found out that in some cases (a = [10, 10], h = 38) your code does not print anything!

so to fix just add

cout << base + n << endl;

at the end!

  • »
    »
    2 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    Thank you so much! I had spent hours and could not figure it out. Will definitely do more stress testing next time