Alternate solution to Codeforces Round 920 problem D?

Правка en1, от Jbi, 2024-01-17 01:12:01

I was doing yesterday's division 3 round, when I stumbled upon problem D. I coded together something that frankly shouldn't work but somehow does and didn't fail to hacks either. I was just wondering if anyone could come up with a rigourous(or non rigourous, idrc) proof of why my solution works.

my code: https://codeforces.me/contest/1921/submission/241787069

The way I got this idea was just doing some stuff on paper until I realized that the max diff for each corresponding element could only really be found at two reasonable spots.

Thanks!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Jbi 2024-01-17 01:12:01 609 Initial revision (published)