How to solve problem F?


Hope strong pretests.Come Up~

I like this kind of contest with strong pretests. For problem D, enumerate the ending points of all values, and then count the number of new values $$$a$$$ each time, and the number of values that are still ending before $$$b$$$. The added contribution of the answer is: COMB(a + b, k) — COMB(b, k).

If a[i] is greater than a[i-1] and a[i+1], add a[i] to the answer. If a[i] is less than a[i-1] and a[i+1], subtract a[i] from the answer. And let a[0]=a[n+1]=0. Change the contribution of up to 6 positions per exchange. Complexity: O(n).

Does anyone check the correctness of the problem A??? Bad experience!

Can problem D find legal arrays of $$$b$$$ and $$$c$$$? upd:Oh, yes, it can be done.

On majkGood Bye 2018, 5 years ago

Problem D. I don't sure it's correctness. a[n]=n*(a[n-1]-1) starting with a[1]=3. ans = n!*(n-2) + a[n-2]

On MikeMirzayanovNew Year Gifts 2019!, 5 years ago

Happy new year! I finally experienced the gray rank!Wowo! Try to experience all kinds of color in Codeforces.

The internet of machine room is out of service, sadly I have to use my wifi to play codeforces....

I dont know the rules of CF.And the other account is mine too.I submit my code on my account and i submit it with this account. Whatever,i am sorry for this thing happened.