Trigger on using stack at problem 313D — Ilya and Roads

Правка en1, от Luftwaffe, 2018-12-15 12:45:31

https://codeforces.com/problemset/problem/313/D Hello everyone. I've solved this problem by dynamic programming, yeah but my teacher after looking at the problem, he said it can be solved by using stack, I'm really "WTF" after what he said, I did ask him how to solve it like that but he explained it and I couldn't understand, so can anyone say whether it is possible to solve it by using stack, I'm kinda curious about that approach ? Thanks a lot.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Luftwaffe 2021-12-23 11:53:51 449
en1 Английский Luftwaffe 2018-12-15 12:45:31 506 Initial revision (published)