
树状数组
lqybzx
123
展开
-
1901: Zju2112 Dynamic Rankings 【带修改的区间第k小数】
Description 给定一个含有n个数的序列a[1],a[2],a[3]……a[n],程序必须回答这样的询问:对于给定的i,j,k,在a[i],a[i+1],a[i+2]……a[j]中第k小的数是多少(1≤k≤j-i+1),并且,你可以改变一些a[i]的值,改变后,程序还能针对改变后的a继续回答上面的问题。你需要编一个这样的程序,从输入文件中读入序列a,然后读入一系列的指令,包括询问指令原创 2014-10-14 17:12:12 · 848 阅读 · 0 评论 -
5-14 数据结构啊poi D.折叠纸片
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=78124#problem/D //想看题目的@willinglive 直接暴力维护就可以了。。。然后折叠超过区间的时候用翻转标记维护一下。【大概直接做也可以过。。?并没有尝试】 #include using namespace std; int n; int tr[100原创 2015-05-15 20:50:39 · 601 阅读 · 0 评论 -
2016多校训练Contest10: 1006 Counting Intersections hdu5862
Problem Description Given some segments which are paralleled to the coordinate axis. You need to count the number of their intersection. The input data guarantee that no two segments share the s原创 2016-08-18 22:46:50 · 358 阅读 · 0 评论 -
hdu 5869 Different GCD Subarray Query 2016ACM/ICPC大连赛区网络赛1002
Problem Description This is a simple problem. The teacher gives Bob a list of problems about GCD (Greatest Common Divisor). After studying some of them, Bob thinks that GCD is so interesting. One d原创 2016-09-16 19:12:56 · 586 阅读 · 0 评论 -
hdu 5892 List wants to travel 2016ACM/ICPC沈阳赛区网络赛1001
Problem Description The Umbrella Company has developed a new biochemical virus secretly. Lyon, a staff of the company, happened to find out the conspiracy and his company is now stopping him from d原创 2016-09-21 20:59:42 · 693 阅读 · 0 评论 -
Codeforces Round 341D
Iahub does not like background stories, so he'll tell you exactly what this problem asks you for. You are given a matrix a with n rows and n columns. Initially, all values of the matrix are zeros原创 2016-09-21 21:01:00 · 345 阅读 · 0 评论 -
hdu 5997 rausen loves cakes
Problem Description Rausen loves cakes. One day, he bought n cakes and the color of each cake is described as an integer in [1,1000000]. Rausen lines the cakes from left to right. Before eat原创 2017-03-19 21:09:44 · 345 阅读 · 0 评论