The other day in COCI Round #3 I didn't solve the problem Zoltan. Turns out the problem involved counting the # of LIS (longest increasing subsequence) in the array. I never wrote this before and wanted to ask Codeforces community to verify that what I want to do is correct.
My idea if the following