自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(43)
  • 收藏
  • 关注

原创 hdu1754 - I Hate It(线段树RMQ)

I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 69021 Accepted Submission(s): 26782Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到

2017-01-29 05:06:03 290

原创 HDU1166 -敌兵布阵(线段树)

敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 82209 Accepted Submission(s): 34700Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Der

2017-01-29 03:51:03 278

原创 hdu1846-Brave Game(BashGame入门)

Brave GameTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11154 Accepted Submission(s): 7490Problem Description 十年前读大学的时候,中国每年都要从国外引进一些电影大片

2017-01-28 21:33:45 245

原创 Codeforces724D. Arpa's weak amphitheater and Mehrdad's valuable Hoses(并查集+背包)

D. Arpa’s weak amphitheater and Mehrdad’s valuable Hoses time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Just to remind, girls in Arpa’s la

2017-01-28 20:53:20 564

原创 POJ3624 - Charm Bracelet(01背包)

Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 36471 Accepted: 15980 DescriptionBessie has gone to the mall’s jewelry store and spies a charm bracelet. Of cour

2017-01-28 20:36:39 298

原创 百练2950:摘花生(模拟)

2950:摘花生 查看 提交 统计 提示 提问 总时间限制: 1000ms 内存限制: 65536kB 描述 鲁宾逊先生有一只宠物猴,名叫多多。这天,他们两个正沿着乡间小路散步,突然发现路边的告示牌上贴着一张小小的纸条:“欢迎免费品尝我种的花生!——熊字”。 鲁宾逊先生和多多都很开心,因为花生正是他们的最爱。在告示牌背后,路边真的有一块花生田,花生植株整齐地排列成矩形网格(如图1)。有经验

2017-01-28 20:34:19 402

原创 百练1833:排列(stl:next_permutation)

1833:排列 查看 提交 统计 提示 提问 总时间限制: 5000ms 内存限制: 65536kB 描述 题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。任务描述: 给出某个排列,求出这个排列的下k个排列,如果遇到最后一个

2017-01-28 20:32:16 350

原创 hdu 1599 Common Subsequence(DP)

Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm> another sequence Z = < z1, z2, …, zk> is

2017-01-28 20:27:11 233

原创 Codevs1078 最小生成树( kruskal )

题目描述 Description 农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场。当然,他需要你的帮助。 约翰已经给他的农场安排了一条高速的网络线路,他想把这条线路共享给其他农场。为了使花费最少,他想铺设最短的光纤去连接所有的农场。 你将得到一份各农场之间连接费用的列表,你必须找出能连接所有农场并所用光纤最短的方案。 每两个农场间的距离不会超过100000

2017-01-24 06:53:49 356

原创 hdu2191- 悼念512汶川大地震遇难同胞――珍惜现在,感恩生活(多重背包)

Problem Description 急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢?后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕

2017-01-23 23:17:48 395

原创 hdu1003 Max Sum(dp)

Problem Description Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 =

2017-01-23 22:41:29 285

原创 Codeforces59 B - Fortune Telling(再水)

B. Fortune Telling time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of

2017-01-23 01:20:44 596

原创 Codeforces59A - Word(水)

A. Word time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vasya is very upset that many people on the Net mix uppercase and lowercase letter

2017-01-23 01:18:21 639

原创 插入排序&归并排序&堆排序

插入排序#include<stdio.h>void insertion_sort(int *arr,int len){ int i,j; int temp; for(int i=1;i<len;i++){ temp=arr[i]; j=i-1; for(;j>=0 && arr[j]>temp;j--){

2017-01-22 18:59:42 257

原创 POJ-3126 Prime Path(BFS 求最小步数)

DescriptionThe 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 m

2017-01-22 04:31:31 334

原创 POJ-1426 Find The Multiple ( BFS )

http://poj.org/problem?id=1426 Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28996 Accepted: 12023 Special Judge DescriptionGiven a positive integer n

2017-01-21 23:32:22 349

原创 POJ-1787 Charlie's Change( 多重背包记录方案)

http://poj.org/problem?id=1787 Charlie’s Change Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 4238 Accepted: 1325 DescriptionCharlie is a driver of Advanced Cargo Movement, Lt

2017-01-21 15:04:12 920

原创 UVA562 Dividing coins (01背包)

Dividing coins Description It’s commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so eager to get it and the

2017-01-21 08:17:22 463

原创 POJ 3624- Charm Bracelet(01背包 滚动数组)

Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 36395 Accepted: 15944 DescriptionBessie has gone to the mall’s jewelry store and spies a charm bracelet. Of cour

2017-01-21 07:32:28 297

原创 hdu2159 Fate(二维费用背包)

http://acm.hdu.edu.cn/showproblem.php?pid=2159 FATETime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 12695 Accepted Submission(s): 6012Proble

2017-01-21 01:13:04 262

原创 hdu 2546 饭卡(01背包+贪心)

http://acm.hdu.edu.cn/showproblem.php?pid=2546 饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 25615 Accepted Submission(s): 8955Problem

2017-01-21 00:34:02 298

原创 hdu 4930 Fighting the Landlords(模拟)

http://acm.hdu.edu.cn/showproblem.php?pid=4930 Fighting the LandlordsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1337 Accepted Submis

2017-01-19 17:31:37 344

原创 POJ3009 Curling 2.0(dfs+剪枝)

http://poj.org/problem?id=3009 Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 19525 Accepted: 7971 DescriptionOn Planet MM-21, after their Olympic games this yea

2017-01-19 02:37:16 496

原创 POJ1111 Image Perimeters(dfs)

Image Perimeters Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8934 Accepted: 5325 DescriptionTechnicians in a pathology lab analyze digitized images of slides. Objects on a sl

2017-01-18 16:54:39 372

原创 codeforces755B. PolandBall and Game(map)

B. PolandBall and Game time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output PolandBall is playing a game with EnemyBall. The rules are simple. P

2017-01-17 21:47:58 828

原创 codefors755A. PolandBall and Hypothesis(打表+二分)

A. PolandBall and Hypothesis time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output PolandBall is a young, clever Ball. He is interested in prime

2017-01-17 21:04:48 388

原创 二叉搜索树(BST)插入与查找

二叉查找树(英语:Binary Search Tree),也称二叉搜索树、有序二叉树(ordered binary tree),排序二叉树(sorted binary tree)二叉查找树的性质: 1.任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 2.任意节点的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 3.任意节点的左、右子树也分别为二叉查找树; 4.没

2017-01-15 22:54:29 1100

原创 POJ - 2785 4 Values whose Sum is 0(二分枚举)

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 the following

2017-01-14 19:39:39 421

原创 poj2871 A Simple Question of Chemistry(水题)

Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the bril

2017-01-14 19:04:37 889

原创 codeforces757A. Gotta Catch Em' All!

A. Gotta Catch Em’ All! time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Bash wants to become a Pokemon master one day. Although he liked a

2017-01-13 21:09:43 732

原创 hdu1114 Piggy-Bank(完全背包)

Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22258 Accepted Submission(s): 11276Problem Description Before ACM can do anything

2017-01-13 00:19:18 329

原创 hdu1203 I NEED A OFFER! (01背包)

I NEED A OFFER!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25976 Accepted Submission(s): 10536Problem Description Speakless很早就想出国,现在他已经

2017-01-12 15:53:16 241

原创 hdu2602 Bone Collector(01背包)

Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 55245 Accepted Submission(s): 23100Problem Description Many years ago , in Te

2017-01-12 10:22:54 228

原创 POJ 2251 Dungeon Master(三维bfs)

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south,

2017-01-07 00:58:40 332

原创 poj1321 棋盘问题 (dfs)

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

2017-01-06 23:19:08 295

原创 hdu2647(拓扑排序)

RewardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7986 Accepted Submission(s): 2540Problem Description Dandelion’s uncle is a boss of a

2017-01-06 13:45:55 309

原创 拓扑排序(算法模板)

有一个有向图(AOV网)如下: 遍历方法: 每次找入度为0的节点,找到后删除该节点和该节点的出度边. 在新的AOV网中(删除某些节点和边后) 重复这个过程在这个图中遍历为 第一步: 0 第二步: 1 或 2 第三步: 4 第四步:3 或 6 第五步:5 第六步:7 共有4种不同拓扑序列拓扑序列反映那些工程得先完成,那些工程得后完成。代码:#include<iostream>

2017-01-06 13:38:57 926

原创 C/C++ 宏的高级使用1.0

单个#引例1.#include<stdio.h>#define P(x) printf("%s=%d\n",#x,x)int main(){ /* #x 的作用就是把x转成"x",转成字符串*/ int a1=10,a2=20,a3=30; P(a1); // 打印 a1=10 P(a2); // 打印 a2=20 P(a3); // 打

2017-01-05 22:45:02 3009 1

原创 Codeforces753A Santa Claus and Candies

A. Santa Claus and Candies time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Santa Claus has n candies, he dreams to give them as gifts to ch

2017-01-05 01:12:45 937

原创 Java PAT练习2.0

2.1 Given number n. Print number from 1 to n. But: when number is divided by 3, print “fizz”. when number is divided by 5, print “buzz”. when number is divided by both 3 and 5, print “fizz buzz”./*

2017-01-05 01:07:31 474

空空如也

空空如也

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

TA关注的人

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