【线段树】【4-6组队赛】Problem H】的更多相关文章

An easy problem A Time Limit: 1000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Problem Description N个数排成一列,Q个询问,每次询问一段区间内的数的极差是多少. Input 第一行两个整数N(1≤N≤50000),Q(1≤Q≤200000).接下来一行N个整数a1 a2 a3 -.an,(1≤ai≤1000000000).接下来Q行,每行两个整数L,R(1≤L…
Super Mario Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9618    Accepted Submission(s): 4074 Problem Description Mario is world-famous plumber. His “burly” figure and amazing jumping ability…
An easy problem B Time Limit: 2000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Problem Description N个数排成一列,每个数的大小为1或者0.有两种操作,第一种操作是把一段区间内的每个数异或1,第二种操作是询问区间内最长连续1的长度. Input 第一行一个整数N(1≤N≤100000),表示N个数.第二行N个数.接下来一行一个整数M(1≤M≤100000),表示…
An easy problem C Time Limit: 4000/2000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Problem Description N个数排成一列,有三种操作.1.给一段区间内的每个数乘上一个非负整数.2.给一段区间内的每个数加上一个非负整数.3.询问一段区间的和模上P的值. Input 第一行两个整数N(1≤N≤100000)表示数的个数,P(1≤P≤1000000000)表示模的值.接下来…
A Simple Problem with Integers Time Limit: 10000MS Memory Limit: 65536K Description You have N integers, A1, A2, - , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv…
Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval. In…
题目链接:https://nanti.jisuanke.com/t/31460 Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge $a[i]$. Unfortunately, the longer he learns, the fewer he gets. That means, if he re…
poj3468 A Simple Problem with Integers 题意:O(-1) 思路:O(-1) 线段树功能:update:成段增减 query:区间求和 Sample Input 10 5 1 2 3 4 5 6 7 8 9 10 Q 4 4 Q 1 10 Q 2 4 C 3 6 3 Q 2 4 Sample Output 4 55 9 15 Hint The sums may exceed the range of 32-bit integers. 题目大意:   N个数 M…
https://vjudge.net/contest/66989#problem/C #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<cmath> #define lson (i<<1) #define rson (i<<1|1) typedef long lo…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 738    Accepted Submission(s): 591 Problem Description In Land waterless, w…