![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
1662小鱼干
这个作者很懒,什么都没留下…
展开
-
I hate it
Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 ),分别代表学生的数目和操作的数目。学生ID编号分别从1编到N。第二行原创 2020-07-27 12:16:55 · 99 阅读 · 0 评论 -
Balanced Lineup - POJ/3264
DescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of c原创 2020-07-27 11:46:18 · 89 阅读 · 0 评论 -
敌兵布阵(线段树-单点修改)
#include<stdio.h>#include<iostream>#include<algorithm>#include<cstring>using namespace std;#define lson 2*k,l,mid#define rson 2*k+1,mid+1,rconst int MAXN = 1e5;int num[MAXN], sum[MAXN*4]; //要开4倍数组 //num 数组记录第i个营地一开始有多...原创 2020-07-25 14:59:07 · 110 阅读 · 0 评论