标签: Hash

「CodeForces 1241F」Stack Exterminable Arrays

Let's look at the following process: initially you have an empty stack and an array 𝑠 of the length 𝑙. You are trying to push array elements to the stack in the order 𝑠1,𝑠2,𝑠3,…𝑠𝑙. Moreover, if the stack is empty or the element at the top of this stack is not equal to the current element, then you just push the current element to the top of the stack. Otherwise, you don't push the current element to the stack and, moreover, pop the top element of the stack.

「POI2010」KOR-Beads

Zxl有一次决定制造一条项链,她以非常便宜的价格买了一长条鲜艳的珊瑚珠子,她现在也有一个机器,能把这条珠子切成很多块(子串),每块有k(k>0)个珠子,如果这条珠子的长度不是k的倍数,最后一块小于k的就不要拉(nc真浪费),保证珠子的长度为正整数。