随笔分类 -  ACM-莫队&分块

摘要:Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks you to count the 阅读全文
posted @ 2018-08-19 23:06 StarHai 阅读(261) 评论(0) 推荐(0)
摘要:维护一个序列,要求支持下列2种操作: add a b c:区间[a,b]中每个数加上c count a b:查询区间[a,b]中有多少数是k的倍数(k为给定常数) 维护一个序列,要求支持下列2种操作: add a b c:区间[a,b]中每个数加上c count a b:查询区间[a,b]中有多少数 阅读全文
posted @ 2018-08-19 22:56 StarHai 阅读(304) 评论(0) 推荐(0)
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan Problem Description There are n intersections in Bytetown, connected with m one way str 阅读全文
posted @ 2018-07-31 22:06 StarHai 阅读(317) 评论(0) 推荐(0)
摘要:There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand 阅读全文
posted @ 2018-03-22 23:29 StarHai 阅读(356) 评论(0) 推荐(0)
摘要:给你一个长度为N的序列ai,1≤i≤N和q组询问,每组询问读入l1,r1,l2,r2,需输出get(l,r,x)表示计算区间[l,r]中,数字x出现了多少次。Input第一行,一个数字N,表示序列长度。第二行,N个数字,表示a1~aN第三行,一个数字Q,表示询问个数。... 阅读全文
posted @ 2018-03-20 17:19 StarHai 阅读(307) 评论(0) 推荐(0)
摘要:Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks ... 阅读全文
posted @ 2018-03-20 17:12 StarHai 阅读(247) 评论(0) 推荐(0)
摘要:某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存... 阅读全文
posted @ 2018-03-12 23:38 StarHai 阅读(173) 评论(0) 推荐(0)
摘要:You have a rooted tree consisting of n vertices. Each vertex of the tree has some color. We will assume that the tree vertices are numbered by integer 阅读全文
posted @ 2018-03-09 21:38 StarHai 阅读(271) 评论(0) 推荐(0)