随笔分类 -  线段树

摘要:在完成了分配任务之后,西部314来到了楼兰古城的西部。 相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(‘V’),一个部落崇拜铁锹(‘∧’),他们分别用V和∧的形状来代表各自部落的图腾。 西部314在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了N个点,经测量发现这N 阅读全文
posted @ 2019-08-10 23:18 black_hole6 阅读(382) 评论(0) 推荐(0)
摘要:P is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble Sort in C++. for(int i=1;i<=N;++i) for(int j=N,t;j>i 阅读全文
posted @ 2019-08-08 21:18 black_hole6 阅读(187) 评论(0) 推荐(0)
摘要:给定长度为N的数列A,以及M条指令,每条指令可能是以下两种之一: 1、“1 x y”,查询区间 [x,y] 中的最大连续子段和,即 maxx≤l≤r≤ymaxx≤l≤r≤y{∑ri=lA[i]∑i=lrA[i]}。 2、“2 x y”,把 A[x] 改成 y。 对于每个查询指令,输出一个整数表示答案 阅读全文
posted @ 2019-08-08 10:00 black_hole6 阅读(290) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/16/A来源:牛客网 题目描述 FST是一名可怜的小朋友,他很强,但是经常fst,所以rating一直低迷。 但是重点在于,他非常适合ACM!并在最近的区域赛中获得了不错的成绩。 拿到奖金后FST决定买一台新笔记本,但是F 阅读全文
posted @ 2019-08-07 10:51 black_hole6 阅读(292) 评论(0) 推荐(0)
摘要:Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Ma 阅读全文
posted @ 2019-08-05 09:23 black_hole6 阅读(258) 评论(0) 推荐(0)
摘要:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacen 阅读全文
posted @ 2019-08-04 17:18 black_hole6 阅读(155) 评论(0) 推荐(0)
摘要:很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行, 阅读全文
posted @ 2019-08-02 11:58 black_hole6 阅读(244) 评论(0) 推荐(0)
摘要: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 cons... 阅读全文
posted @ 2019-04-09 16:23 black_hole6 阅读(124) 评论(0) 推荐(0)
摘要: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 numbe... 阅读全文
posted @ 2019-04-09 16:04 black_hole6 阅读(187) 评论(0) 推荐(0)
摘要:很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文... 阅读全文
posted @ 2019-04-09 11:44 black_hole6 阅读(132) 评论(0) 推荐(0)
摘要:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚... 阅读全文
posted @ 2019-04-08 23:43 black_hole6 阅读(165) 评论(0) 推荐(0)
摘要:N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#include#include#define maxn 50005using namespace std;int lazy[1000005],N;struct no... 阅读全文
posted @ 2018-12-15 11:22 black_hole6 阅读(207) 评论(0) 推荐(0)