
数据结构
文章平均质量分 76
linmory
头疼....太难了
展开
-
nyoj123士兵杀敌(四)(树状数组)
士兵杀敌(四)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军麾下有百万精兵,现已知共有M个士兵,编号为1~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情,军师小工的任务就是原创 2017-10-19 10:22:18 · 188 阅读 · 0 评论 -
Chip Factory (字典树求异或最大值)
John is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage large amounts of products, every processor has a serial number. More specifically, the factory produc...原创 2018-10-11 10:04:07 · 240 阅读 · 0 评论 -
Ryuji doesn't want to study
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]a[i].Unfortunately, the longer he learns, the fewer he gets.That m...原创 2018-09-11 10:47:58 · 271 阅读 · 0 评论 -
Problem A. Ascending Rating
Problem A. Ascending Rating Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 3287 Accepted Submission(s): 1083 Problem D...原创 2018-07-31 16:57:40 · 242 阅读 · 0 评论 -
字段求和
1081 子段求和 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出一个长度为N的数组,进行Q次查询,查询从第i个元素开始长度为l的子段所有元素之和。例如,1 3 7 9 -1,查询第2个元素开始长度为3的子段和,1 {3 7 9} -1。3 + 7 + 9 = 19,输出19。Input第1行:一个数N,N为数组的长度(2 <= N <= ...原创 2018-07-14 18:17:22 · 551 阅读 · 0 评论 -
Sliding Window POJ - 2823
An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each tim...原创 2018-05-17 08:57:41 · 186 阅读 · 0 评论 -
2269: minval(优先队列)
2269: minval时间限制: 3 Sec 内存限制: 256 MB提交: 621 解决: 62[提交][状态][讨论版][命题人:外部导入]题目描述有两个长度为N的序列A和B,在A和B中各任取一个数相加可以得到N2个和,求这N2个和中最小的N个。 输入第一行输入一个正整数N(1第二行N个整数Ai且Ai输出输出仅一行,包含n个整数,从原创 2018-04-21 19:22:04 · 220 阅读 · 0 评论 -
Cinema in Akiba(线段树)
I - Cinema in AkibaCinema in Akiba (CIA) is a small but very popular cinema in Akihabara. Every night the cinema is full of people. The layout of CIA is very interesting, as there is only one row so原创 2018-05-09 16:13:24 · 236 阅读 · 0 评论 -
Group(区间查询 莫队)hdu 4638
GroupTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3056 Accepted Submission(s): 1530Problem DescriptionThere are n men ,every m原创 2018-04-18 21:16:34 · 162 阅读 · 0 评论 -
A Simple Problem with Integers poj3468(线段树区间更新,区间查询)
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 128832 Accepted: 39978Case Time Limit: 2000MSDescriptionYou have N integers, A1, A2, ... , AN. Yo原创 2018-04-17 20:57:50 · 199 阅读 · 0 评论 -
数据结构最小生成树两个算法
#include#include#include#include#define MaxInt 1000000#define MVNum 100#define Vexcount 4using namespace std;typedef unsigned int ArcType;//边的权值类型typedef int VerTexType; //顶点的原创 2017-12-29 19:13:00 · 445 阅读 · 0 评论 -
HDU1166:敌兵布阵(线段树单点更新,区间查询)
敌兵布阵C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报原创 2017-10-11 19:32:23 · 195 阅读 · 0 评论 -
HDU - 4027 Can you answer these queries?(线段树区间更新,区间查询)
A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a valu原创 2017-10-25 21:46:25 · 154 阅读 · 0 评论 -
nyoj 119 士兵杀敌(三)线段树
士兵杀敌(三)时间限制:2000 ms | 内存限制:65535 KB 难度:5描述 南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号原创 2017-10-22 21:27:31 · 182 阅读 · 0 评论 -
nyoj 228士兵杀敌(五)
士兵杀敌(五)时间限制:2000 ms | 内存限制:65535 KB 难度:5描述 南将军麾下有百万精兵,现已知共有M个士兵,编号为0~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情。在这样原创 2017-10-22 14:18:17 · 263 阅读 · 0 评论 -
HDU - 5927Auxiliary Set (树dfs+LCA)
Given a rooted tree with n vertices, some of the vertices are important.An auxiliary set is a set containing vertices satisfying at least one of the two conditions:∙∙It is an important vertex∙∙I...原创 2019-05-29 20:47:02 · 148 阅读 · 0 评论