why my approach is always wrong

Revision en1, by mac_n_cheese_pog, 2021-08-08 15:39:46

https://mirror.codeforces.com/contest/810/problem/B see this problem and see my code https://pastebin.com/U3p3vCwD

my approach: i make pair,find maximum v[i].first and then check if second is >0 then multiply it.

if u dont understand my code just try to analyze my code.i think its pretty straightforward.

Tags #greedy

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English mac_n_cheese_pog 2021-08-08 15:39:46 340 Initial revision (published)