题目描述: 给你一个长度为n的最开始为0的数以及m个更新操作以及数据生成器参数X,Y,Z.每次操作,将由数据生成器生成出li,ri,vi.让你从区间[li,ri]中,将所有小于vi的数变为vi.最后让你求从1到n的 i*ai的亦或和. 分析:区间操作优先考虑线段树 , 那线段树存储什么数值呢? 我们知道如果l ,r 的最大值<=val , 那整个l区间都要改成val , 如果最小值>=val  那这个区间就不用修改 : 那不是这种情况怎么办呢?不可能是for一遍吧 , 其实只要一次跟新操作就好…
lines Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1575    Accepted Submission(s): 656 Problem Description John has several lines. The lines are covered on the X axis. Let A is a point which…
题目链接:http://acm.upc.edu.cn/problem.php?id=2224 题意:给出n个数pi,和m个查询,每个查询给出l,r,a,b,让你求在区间l~r之间的pi的个数(A<=pi<=B,l<=i<=r). 参考链接:http://www.cnblogs.com/zj62/p/3558967.html #include <iostream> #include <cstdio> #include <cstring> #incl…
Queue-jumpers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3348    Accepted Submission(s): 904 Problem Description Ponyo and Garfield are waiting outside the box-office for their favorite mo…
Sequence operation Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7502    Accepted Submission(s): 2233 Problem Description lxhgww got a sequence contains n characters which are all '0's or '1…
Atlantis Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10208    Accepted Submission(s): 4351 Problem Description There are several ancient Greek texts that contain descriptions of the fabled i…
Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3897    Accepted Submission(s): 1978 Problem Description A number of rectangular posters, photographs and other pictures of the same shape…
Level up Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3973    Accepted Submission(s): 1104 Problem Description Level up is the task of all online games. It's very boooooooooring. There is o…
Problem Nice boat(HDU 4902) 题目大意 维护一个序列,两种操作. 第一种操作,将一段区间[l,r]赋值为x. 第二种操作,将一段区间[l,r]中大于等于x的数与x求gcd. 询问所有操作结束后的序列. 解题分析 用线段树开一个标记same,表示这段区间中的数是否相同,若相同则为该数,否则为-1. 对于第二种操作,对于覆盖区间内的same不为-1的子区间暴力修改. 虽然时限有15s,但貌似跑得挺快的,只用了1s,不知是数据水还是什么缘故. 参考程序 #include <c…
Weak Pair Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 439    Accepted Submission(s): 155 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a…