can anyone tell me why this is wrong approach. please!!!!!

Revision en1, by isitcorrect, 2025-09-13 15:23:25

in problem https://mirror.codeforces.com/contest/1579/problem/D

my previous solution has core implementation https://mirror.codeforces.com/contest/1579/submission/338348122 in this i was taking two biggest numbers a,b and saving them min(a,b)*times in answer vector but it gave wrong answer on 2nd test case

this gets accepted https://mirror.codeforces.com/contest/1579/submission/338349269

but when i checked the other solution they were simulating one by one pairs i didn't get what difference will it create when taking all simultenously or taking one by one why take one by one here

please help!!!

Tags priority queue, greedy, need help, help me please

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English isitcorrect 2025-09-13 15:23:25 661 Initial revision (published)