
莫队算法
傻不拉叽
这个作者很懒,什么都没留下…
展开
-
Little Elephant and Array
Description The Little Elephant loves playing with arrays. He has array a, consisting of n positive integers, indexed from 1 to n. Let’s denote the number with index i as ai. Additionally the Littl...原创 2018-05-19 22:35:44 · 510 阅读 · 0 评论 -
D-query
Description Given a sequence of n numbers a1, a2, …, an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct eleme...原创 2018-05-19 22:46:10 · 255 阅读 · 0 评论 -
小Z的袜子(hose)
Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。 你的任务便是告诉小Z,他...原创 2018-05-19 22:39:27 · 180 阅读 · 0 评论