自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

qq_43331910的博客

默默刷题

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

原创 POJ 1251 Jungle Roads(Prim+Kruscal)

Prim:一开始自己写了个函数找字母和数字对应关系WA,利用ASCII就对了。。。仔细一看26个字母写错了。。。敲代码的时候就担心这个问题还检查过还是错了,引以为戒!#include <stdlib.h>#include <stdio.h>#include <iostream>#include <queue>#include &...

2019-09-03 20:34:00 178

原创 HDU 1233 还是畅通工程(Prim,Kruscal)

题目描述:思路分析:最小生成树最小生成树——Kruscal#include <stdlib.h>#include <stdio.h>#include <iostream>#include <queue>#include <stack>#include <string.h>#...

2019-08-30 18:51:43 146

原创 POJ 2560 Freckles (Prim,Kruscal)

题目描述:思路分析:最小生成树Kruscal:#include <stdlib.h>#include <stdio.h>#include <iostream>#include <queue>#include <stack>#include <string.h>#include <...

2019-08-30 17:23:09 202

原创 POJ 3268 Silver Cow Party

One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way ro...

2019-08-24 11:55:35 123

原创 UVA 11624 Fire!

题目描述:Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fireescape plan. Help Joe escape the maze. Given Joe’s location in t...

2019-08-23 19:29:28 238

原创 动态规划——数字塔

题目描述:第i行有i个数字,每次只能向下或向正右方走,求和最大的路径的和31 58 4 32 6 7 96 2 3 5 1与贪心算法不同的是,因为每次只能向下或向右走,每次走的方向会导致后面结果发生改变。用动态规划的思想解决。仔细分析可以得到数字与左边数字和上边数字的数量关系,用另一个数组去记录每一个数字...

2019-08-21 16:33:43 734

原创 HDU 1950 Bridging signals

题目链接题目描述:'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecti...

2019-08-21 10:42:06 148

原创 动态规划问题——招聘会

题目背景:那一年,这一年,青春散场,到毕业季,我们奔波着忙着找工作,来到招聘会上,看到黑压压的一大片人群..题目描述:毕业季,很多大公司来学校招聘,招聘会分散在不同时间段,小明想知道自己最多能完整的参加多少个招聘会(参加一个招聘会的时候不能中断或离开)。 假设现在有n个招聘会,每个招聘会都有个起止时间,时间由从招聘会第一天0点开始的小时数表示,n <= 1000 。 返回:最多参...

2019-08-20 10:05:21 289

原创 HDU 2041 超级楼梯

题目描述:有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法?Input输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1<=M<=40),表示楼梯的级数。Output对于每个测试实例,请输出不同走法的数量Sample Input223Sample Output12...

2019-08-19 16:31:12 248

原创 HRBUST 1835 最长递增子序列

题目描述:给出一个数字序列求其最长的递增子序列例如序列(1,7,3,5,9,4,8).(1,7)和(3,4,8)是其递增子序列但其最长的递增子序列是(1,3,5,8)。Input本题有多组测试数据,对于每组测试数据第一行是一个整数n(n<=100)代表序列长度。第二行是n个整数。Output最长递增子序列长度Sample Input71 7 3 ...

2019-08-19 16:24:52 203

原创 POJ 1724 ROADS

题目描述:找一条路径最短条件下的花费最少的路!!!看反了改了一下午!!!稀疏图,用邻接表,否则超出内存限制用优先队列储存到达每一个点的时候的状态,重载小于号修改排序规则,这样队首一定是当前条件下最优选择又有点像bfs#include <stdlib.h>#include <stdio.h>#include <iostream>#i...

2019-08-19 10:19:45 179

原创 POJ 1797 Heavy Transportation

题目描述:在图中找一条最小权值最大的行遍所有点的路思路分析:每一步都走权值最大点,注意松弛操作AC#include <stdlib.h>#include <stdio.h>#include <iostream>#include <queue>#include <stack>#inclu...

2019-08-17 10:43:00 170

原创 POJ 2253 Frogger

题目描述:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of touris...

2019-08-17 09:08:11 133

原创 HDU 1874 畅通工程续

题目描述:某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据第一行包含两个正整数N和M(0<N<200...

2019-08-14 18:23:11 298

原创 POJ 2387 Til the Cows Come Home

题目描述:Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants t...

2019-08-14 10:56:33 108

原创 HDU 1022 Train Problem I

题目描述:反思:用数组的时候一定要注意下标范围不要越界!栈弹出之前先检测是否为空#include <stdlib.h>#include <stdio.h>#include <iostream>#include <queue>#include <stack>#include <algorithm&...

2019-08-13 11:00:45 132

转载 504 Gateway Time-out解决方法

504 Gateway Time-out就字面意思,我们可以理解为网页请求超时,也就是浏览网站网页所发出的请求没有反应或者未响应,在网站程序层面来说,就是请求未能够执行相应的PHP-CGI程序,或者PHP-CGI程序未能做出相应的处理,又或者是CGI程序的响应处理结果未能够反馈到浏览器或者未能及时反馈到浏览器。是由于nginx默认的fastcgi进程响应缓冲区太小造成: 这种情况下导致fast...

2019-08-12 10:46:56 180275 1

原创 HDU 1969 Pie

题目描述: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 and e...

2019-08-10 18:11:59 167

原创 HDU 2899 Strange fuction

题目描述:Now, here is a fuction:F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 100.InputThe first line of the input contains an i...

2019-08-10 16:00:40 228

原创 HDU 2199 Can you solve this equation?

题目描述:Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.InputThe first line of the input contains an integer T(1&l...

2019-08-09 17:00:45 135

原创 POJ 2492 A Bug's Life

题目描述:背景霍珀教授正在研究一种稀有昆虫的性行为。他假设它们有两种不同的性别,而且它们只与异性昆虫互动。在他的实验中,单个的虫子及其相互作用很容易识别,因为它们的背上印着数字。问题给定一个bug交互列表,判断这个实验是否支持他的假设,即没有同性恋bug的两种性别,还是包含一些错误的bug交互。Sample Input23 31 22 31 34 21 ...

2019-08-09 10:04:48 189

原创 HDU 3635 Dragon Balls

Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dragon balls together.His country has N cities ...

2019-08-08 18:33:17 242

原创 HihoCoder 1515 分数调查

题目描述:小Hi的学校总共有N名学生,编号1-N。学校刚刚进行了一场全校的古诗文水平测验。 学校没有公布测验的成绩,所以小Hi只能得到一些小道消息,例如X号同学的分数比Y号同学的分数高S分。 小Hi想知道利用这些消息,能不能判断出某两位同学之间的分数高低?Input第一行包含三个整数N, M和Q。N表示学生总数,M表示小Hi知道消息的总数,Q表示小Hi想询问的数量。 ...

2019-08-08 17:53:39 136

原创 POJ 2524 Ubiquitous Religions

题目描述:There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your universi...

2019-08-08 12:22:54 106

原创 HDU 1232 畅通工程

题目描述:某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道...

2019-08-08 11:05:06 123

原创 POJ 1182 食物链(两种解法)

题目描述:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K...

2019-08-06 17:07:34 1075

原创 UVA 679 Dropping Balls

题目描述 :A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, eit...

2019-08-02 18:21:41 135

原创 HDU 1495 非常可乐

题目描述:大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M...

2019-07-30 19:10:29 160

原创 POJ 2251 Dungeon Master

题目描述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,...

2019-07-29 09:09:04 93

原创 CodeForce 566D Restructuring Company

题目描述Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departments, fire employees and do other unpleasant stuf...

2019-07-28 18:58:40 199

原创 POJ 2236 Wireless Network

题目描述An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers i...

2019-07-28 18:52:41 118

原创 POJ 2379 ACM Rank Table

题目描述ACM contests, like the one you are participating in, are hosted by the special software. That software, among other functions, preforms a job of accepting and evaluating teams' solutions (run...

2019-07-24 10:21:59 307

原创 HDU2717 Catch That Cow (BFS)

题目描述Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤...

2019-07-23 17:28:52 140

空空如也

空空如也

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

TA关注的人

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