线段树
chen_zan_yu_
同是寒窗苦读,岂能甘拜下风
展开
-
P1531 I Hate It(史上最好懂的线段树之一)
题目背景很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。题目描述不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩输入输出格式输入格式: 第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 ),分...原创 2018-10-29 08:07:34 · 193 阅读 · 0 评论 -
G - Balanced Lineup ( 线段树+区间查询无更新)
For 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 ...原创 2018-10-30 12:34:17 · 136 阅读 · 0 评论 -
C - A Simple Problem with Integers ((区间更新))
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 ...原创 2018-10-27 11:28:05 · 193 阅读 · 0 评论 -
小旭追女神-三国乱世(裸的单点线段树更新)
小旭追女神-三国乱世Time Limit: 1000 ms Memory Limit: 65536 KiBSubmit Statistic DiscussProblem Description最近室友都开始玩起来三国杀了,这让小旭很郁闷,(因为小旭不会啊),所以为了能和小伙伴们一起玩耍,小旭决定重读三国,一天小旭晚上梦回三国。话说: 太祖武皇帝,沛国谯人也,姓曹,讳操,字孟德,汉...原创 2018-10-27 10:25:23 · 456 阅读 · 0 评论 -
E - Just a Hook (线段树+区间更新)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pud...原创 2018-10-30 09:29:10 · 200 阅读 · 0 评论 -
A - 敌兵布阵
大大牢牢嘀嗒嘀嗒---题目连接C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中...原创 2018-10-26 22:01:59 · 197 阅读 · 0 评论 -
B - I Hate It (单点更新)(区间求最大值)
嘀嗒嘀嗒--题目连接 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=20000...原创 2018-10-26 21:45:12 · 164 阅读 · 0 评论 -
P1531 I Hate It(史上最好懂的线段树之一)
题目背景嘀嗒嘀嗒---题目连接很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。题目描述不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩输入输出格式输入格式: 第一行,有两个正整数 N 和 M ( 0<N<=200000,0<...原创 2018-10-26 21:06:41 · 309 阅读 · 2 评论 -
D - Mayor's posters (线段树 + 离散化)
滴答滴答---题目链接The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council ...原创 2018-10-31 09:41:20 · 183 阅读 · 0 评论 -
F - Count the Colors (覆盖后还存在的原色的数目)
Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last. ...原创 2018-11-02 09:11:00 · 214 阅读 · 0 评论
分享