TIMBERAUCTION OPC TLE

Question link: TIMBER

My Code: Link

I get TLE on testcase 0 and 9.
Can anyone please help me?

C ≤ 1000000

You should switch to scanf/printf for such large amount of data. Also you should make sure area doesn’t contains any garbage values in area[x][0] and area[0][y]

1 Like

Thank you! scanf worked!