79336291

Date: 2025-01-07 14:17:50
Score: 1.5
Natty:
Report link

No worries, Found what was wrong It was just comparison in the while loop

while(!pq.empty() && pq.top().first <= v[i])

Here, value of v[i] can get smaller than first value of priority queue, because of using mod on v[i], to get the correct answer, I needed to compare that with complete value without modding it

Changed it to this

while(!pq.empty() && (cnt > 32 || pq.top().first <= sa*(1ll << cnt)))

And it worked, though priority queue gave a TLE

Reasons:
  • Blacklisted phrase (0.5): I need
  • Whitelisted phrase (-1): it worked
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Parag Patkulkar