Greedy algoritms

what can i do if i come with greedy aproach but can’t prove solution? (if it is accepted)

Are you asking what to do if you have an AC greedy solution that you can’t exactly prove?


I’m not sure how to exactly help you here. Maybe look at the official editorial for their solution, or ask some other people if they have any ideas.

What is your goal/point of proving it? If it’s accepted, that means it’s good enough - there’s no need to prove it…

I don’t know about you, but I’m really uncomfortable when I code an algorithm that works but I don’t know why.

Well, yeah me too, but if you can’t figure it out after trying everything you know, there isn’t much else to do(except finding outside help).

You could put your algorithm here and see if anyone else can help with it. We can’t do much without actually seeing it…