HDU
文章平均质量分 75
SPZn_up
这个作者很懒,什么都没留下…
展开
-
HDU 2084 数塔(DP初步应用)
HDU 2084 数塔在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1原创 2015-01-13 22:00:57 · 488 阅读 · 0 评论 -
hdu 5093 Battle ships(最大流 || 二分图)
hdu 5093 Battle shipsDescriptionDear contestant, now you are an excellent navy commander, who is responsible of a tough mission currently.Your fleet unfortunately encountered a原创 2015-08-03 16:43:13 · 670 阅读 · 0 评论 -
hdu 4292 Food (最大流)
hdu 4292 FoodDescription You, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many people as possible. The issue comes up as people原创 2015-08-02 20:57:40 · 816 阅读 · 0 评论 -
hdu 3572 Task Schedule(最大流)
hdu 3572 Task ScheduleDescription Our geometry princess XMM has stoped her study in computational geometry to concentrate on her newly opened factory. Her factory has introduced M new machines in orde原创 2015-08-02 21:10:09 · 981 阅读 · 0 评论 -
hdu 5340 Three Palindromes(字符串处理+ 回文)
hdu 5340 Three Palindromes问题描述 判断是否能将字符串S分成三段非空回文串。 输入描述 第一行一个整数T,表示数据组数。T \leq 20T≤20 对于每一个组,仅包含一个由小写字母组成的串。1 \leq |S| \leq 200001≤∣S∣≤20000 输出描述 对于每一组,单行输出”Yes” 或 “No”。 输入样例 2 abc abaadada原创 2015-08-02 10:25:33 · 812 阅读 · 0 评论 -
hdu 5339 Untitled(回溯)
hdu 5339 Untitled题目大意:给出n个数字的序列,和一个数a,在n中有m个数b1,...,bmb1,...,bm使得__a %b1%b2%...%bm = 0__a %b1%b2%...%bm = 0,求最小的m。解题思路:回溯。#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#inc原创 2015-08-02 10:34:33 · 444 阅读 · 0 评论 -
hdu 1281 棋盘游戏(二分图匹配)
hdu 1281 棋盘游戏Description 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有原创 2015-08-29 18:38:24 · 574 阅读 · 0 评论 -
hdu 1045 Fire Net(最大流)
hdu 1045 Fire NetDescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a pie原创 2015-08-03 19:31:30 · 580 阅读 · 0 评论 -
hdu 2819 Swap(二分图匹配)
hdu 2819 SwapDescription Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1?Input There原创 2015-08-30 15:08:27 · 604 阅读 · 0 评论 -
hdu 1875 畅通工程再续 (最小生成树)
hdu 1875 畅通工程再续Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大原创 2015-08-17 20:51:23 · 467 阅读 · 0 评论 -
hdu 2433 Travel (最短路径树)
hdu 2433 TravelDescription One day, Tom traveled to a country named BGM. BGM is a small country, but there are N (N <= 100) towns in it. Each town products one kind of food, the food will be tra原创 2015-08-17 21:07:43 · 988 阅读 · 0 评论 -
hdu 1233 还是畅通工程 (最小生成树)
hdu 1233 还是畅通工程Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input 测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N原创 2015-08-17 20:49:16 · 704 阅读 · 0 评论 -
hdu 4370 0 or 1 (最短路)
hdu 4370 0 or 1Description Given a n*n matrix C ij (1<=i,j<=n),We want to find a n*n matrix X ij (1<=i,j<=n),which is 0 or 1.Besides,X ij meets the following conditions:1.X 12+X 13+…X 1n=1 2.X 1n+X 2原创 2015-08-14 21:42:59 · 1203 阅读 · 0 评论 -
uva 1306 The K-League (最大流)
uva 1306 The K-LeagueDescription Supporters for the professional soccer clubs participating in the K-League, formerly the Korea Professional Soccer League, hold orderly and organized cheering, as did原创 2015-08-30 15:25:58 · 814 阅读 · 0 评论 -
hdu 5167 Fibonacci(DFS)
hdu 5167 Fibonacci问题描述斐波那契数列的递归定义如下:Fi=⎧⎩⎨01Fi−1+Fi−2i = 0i = 1i > 1现在我们需要判断一个数是否能表示为斐波那契数列中的数的乘积。输入描述有多组数据,第一行为数据组数T(T≤100,000)。对于每组数据有一个整数n,表示要判断的数字。0≤n≤1,000,000,000输出描述对于每原创 2015-02-02 17:28:10 · 852 阅读 · 0 评论 -
hdu 5163 Taking Bus(模拟)
hdu 5163 Taking Bus问题描述Bestland有一条非常长的马路,马路上设有n个公交汽车站。公交汽车站从左到右标号为1到n。有m个人想要乘公交。你的任务是找出每个人到终点为止所需要的时间。注意:你需要用来解决这道题目的信息在Input里面,请仔细阅读。输入描述输入的第一行包含一个整数T (1≤T≤60),表示测试数据的组数。对于每组测试数据:第一行包原创 2015-02-03 17:41:54 · 673 阅读 · 0 评论 -
HDU 1754 I Hate It(线段树初步应用)
HDU 1754 I Hate ItDescription很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理原创 2014-12-28 19:26:38 · 525 阅读 · 0 评论 -
HDU 1166 敌兵布阵(线段树的初步应用2)
HDU 1166 敌兵布阵DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少原创 2014-12-28 22:45:52 · 436 阅读 · 0 评论 -
hdu 3081 Marriage Match II (二分+最大流+并查集)
hdu 3081 Marriage Match IIDescription Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is similar as the game of playing house we used to play when we原创 2015-08-12 18:54:35 · 680 阅读 · 0 评论 -
hdu 4360 As long as Binbin loves Sangsang(最短路)
hdu 4360 As long as Binbin loves SangsangDescription Binbin misses Sangsang so much. He wants to meet with Sangsang as soon as possible. Now Binbin downloads a map from ELGOOG.There are N (1<=N<=1,3原创 2015-07-31 14:25:00 · 647 阅读 · 0 评论 -
hdu 4396 More lumber is required(最短路)
hdu 4396 More lumber is requiredDescription “More lumber(木材) is required” When the famous warcrafts player Sky wants to build a Central Town, he finds there is not enough lumber to build his Central T原创 2015-07-31 16:14:16 · 940 阅读 · 0 评论 -
hdu 4034 Graph(floyd)
hdu 4034 GraphDescription Everyone knows how to calculate the shortest path in a directed graph. In fact, the opposite problem is also easy. Given the length of shortest path between each pair of vert原创 2015-07-31 19:21:00 · 622 阅读 · 0 评论 -
hdu 3416 Marriage Match IV (最短路+最大流)
hdu 3416 Marriage Match IVDescription Do not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are原创 2015-08-13 10:02:00 · 1132 阅读 · 0 评论 -
hdu 3338 Kakuro Extension(最大流)
hdu 3338 Kakuro ExtensionDescription If you solved problem like this, forget it.Because you need to use a completely different algorithm to solve the following one. Kakuro puzzle is played on a grid原创 2015-08-02 21:24:19 · 801 阅读 · 0 评论 -
hdu 5386 Cover (暴力)
hdu 5386 CoverDescription You have an matrix.Every grid has a color.Now there are two types of operating: L x y: for(int i=1;i<=n;i++)color[i][x]=y; H x y:for(int i=1;i<=n;i++)color[x][i]=y; Now原创 2015-08-14 15:37:13 · 877 阅读 · 0 评论 -
hdu 5352 MZL's City (最大流 || 费用流)
hdu 5352 MZL’s CityDescription MZL is an active girl who has her own country.Her big country has N cities numbered from 1 to N.She has controled the country for so long and she only remebered that the原创 2015-08-05 14:18:55 · 688 阅读 · 0 评论