自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 问答 (2)
  • 收藏
  • 关注

原创 HDU 1754 线段树-I Hate It

Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0#include <iostream>

2016-08-15 16:44:53 277

原创 HDU-1166 线段树-敌兵布阵

Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研究

2016-08-15 16:40:03 364

原创 HDU1698 线段树+区间更新+懒惰标记-Just a Hook

Description 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.

2016-08-15 14:44:19 514

原创 POJ-1611 并查集-The Suspects

Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best stra

2016-08-10 17:25:56 349

原创 HDU 3172 并查集-Virtual Friends

Description These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their fr

2016-08-10 17:18:07 305

原创 HDU 1558 计算几何、并查集-Segment set

Description A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some segment set

2016-08-10 12:25:41 311

原创 POJ - 2386 dfs-Lake Counting

Description Due to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains ei

2016-08-04 21:04:29 267

原创 poj3254 状态压缩dp-Corn Fields

DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Reg

2016-08-04 15:52:04 230

原创 poj 1185 状态压缩dp-炮兵阵地

Description 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用”H” 表示),也可能是平原(用”P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能

2016-08-04 15:43:54 348

原创 poj 1321 状态压缩dp-棋盘问题

Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k

2016-08-04 15:28:06 288

原创 CodeForces 681C 模拟-Heap Operations

DescriptionPetya has recently learned data structure named “Binary heap”.The heap he is now operating with allows the following operations:put the given number into the heap;get the value of the minim

2016-08-02 17:21:07 322

原创 HDU 1242 BFS-Rescue

Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel’s friends

2016-08-02 17:10:22 182

原创 HDU 1241 BFS-Oil Deposits

DescriptionGeoSurvComp地质调查公司负责探测地下石油储藏。 GeoSurvComp现在在一块矩形区域探测石油,并把这个大区域分成了很多小块。他们通过专业设备,来分析每个小块中是否蕴藏石油。如果这些蕴藏石油的小方格相邻,那么他们被认为是同一油藏的一部分。在这块矩形区域,可能有很多油藏。你的任务是确定有多少不同的油藏。Input输入可能有多个矩形区域(即可能有多组测试)。每个矩形区域

2016-08-02 16:50:28 300

原创 CodeForces 689B BFS-Mike and Shortcuts

DescriptionRecently, Mike was very busy with studying for exams and contests. Now he is going to chill a bit by doing some sight seeing in the city.City consists of n intersections numbered from 1 to n

2016-08-02 16:47:12 325

原创 POJ 1426 BFS-Find The Multiple

Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 2

2016-08-02 16:35:04 212

原创 POJ 3126 BFS-Prime Path

Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a

2016-08-02 16:28:51 194

原创 POJ 1915 BFS-Knight Moves

Description Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The Problem Your task is

2016-08-02 16:17:28 202

原创 HDU1312 BFS-Numerically Speaking

Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles.

2016-07-30 08:59:24 269

转载 Sticks

Description 速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用’+’,’-‘,’*’,’/’运算符以及括号改变运算顺序,使得最终运算结果为24(每个数必须且仅能用一次)。游戏很简单,但遇到无解的情况往往让人很郁闷。你的任务就是针对每一组随机产生的四张牌,判断是否有解。我们另外规定,整个计算

2016-07-24 10:21:51 652

转载 速算24点

Description 速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用’+’,’-‘,’*’,’/’运算符以及括号改变运算顺序,使得最终运算结果为24(每个数必须且仅能用一次)。游戏很简单,但遇到无解的情况往往让人很郁闷。你的任务就是针对每一组随机产生的四张牌,判断是否有解。我们另外规定,整个计算

2016-07-24 10:17:07 4317

原创 Network Saboteur

Description A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order to

2016-07-24 09:06:48 239

原创 Prime Ring Problem

Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the nu

2016-07-24 08:58:18 160

原创 N皇后问题

Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output 共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sampl

2016-07-24 08:47:20 202

原创 E - 4 Values whose Sum is 0

Description The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In

2016-07-21 19:48:25 368

原创 D - Pie

Description My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party

2016-07-21 19:45:13 353

原创 C - Sacrament of the sum

Description — The Brother of mine, the Head of Monastic Order wants to know tomorrow about the results long-term researches. He wants to see neither more nor less than the Summering Machine! Even more

2016-07-21 19:41:41 418

原创 B - Can you solve this equation?

Description 现在,给出等式8* X^4+ 7* X^3+ 2* X^2+ 3 * X +6= Y,请找出他在0和100之间的解(包含0和100)。 现在,请你试试运气。。。。Input输入的第一行包含一个整数T(1 <= T <=100),表示测试用例的数目。接下来T个数字,每一行都有一个实数Y(abs(Y)<=10^10);Output 对于每个测试用例,如果有解,你应该输出一个

2016-07-21 19:38:28 1034

转载 A - Can you find it?

Description Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+Ck = X.Inp

2016-07-21 19:35:19 223

原创 E - Raising Modulo Numbers

ACM 快速幂

2016-07-21 15:44:27 557

原创 D - Spreadsheets

ACM Spreadsheets

2016-07-21 15:41:35 494

原创 C - Strange fuction

ACM 二分法

2016-07-21 15:33:43 273

原创 B - Rightmost Digit

ACM

2016-07-21 15:27:03 250

原创 A - Theatre Square

ACM Theatre Square

2016-07-21 15:14:37 614

原创 链式线性表的c++实现

//FILE: List.h//CLASS PROVIDED: List(线性表的链式储存结构)////CONSTRUCTOR for the List class://List();//后置条件:建立头结点////void GetElem_L(int i, int &e);//前置条件:下标i在长度范围之内//后置条件:若下标i在长度范围之内,则将下标i对应的元素赋值给e,否则

2015-03-18 23:26:35 555

原创 顺序线性表的c++实现

//第一次发代码啊,新手而已//list.h#ifndef LIST_H#define LIST_Hclass List{public: List();//创建最大长度为100的线性表 List(int size);//创建最大长度为size的线性表' ~List();//删除线性表 void CreatList(int length);//向线性表输入length个元素 voi

2015-03-17 23:30:30 378

原创 第一篇

1.静态成员常量不仅要在类定义里写,也要在类实现里写,但static不能重复,因为在类定义外static有不同的含义。2.size_t为负整型,在〈cstdlib〉中,适合用于描述数组等长度;3.copy函数,用法为copy(,,),作用是将数组从beginning location到ending location的数据移到destination去;4.typedef适用于将依据实际情

2015-03-16 21:11:32 328

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除