码迷,mamicode.com
首页 >  
搜索关键字:uva 10801    ( 8022个结果
uva 11294
Problem E: WeddingUp to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom s...
分类:其他好文   时间:2014-05-05 22:10:59    阅读次数:373
UVA 674 Coin Change
Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of mone...
分类:其他好文   时间:2014-05-04 12:00:00    阅读次数:363
UVA 10405 Longest Common Subsequence
最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing namespace std;int dp[1001][1001];int MAX(int x,int y){ if (...
分类:其他好文   时间:2014-05-04 11:34:41    阅读次数:294
uva 10269 最短路+dp
题意:有a个村庄、b个城镇, 编号分别为:1—a , a+1——a+b 。 有双神奇的鞋,可以瞬时移动,可以使用k次,每次可以移动L , 但穿这双鞋的时候,不能经过城镇 , 问:从a+b 到 1 最短距离是多少? 刚开始看这个题时 , 一点思路都没有 , dp类型的题目做得太少了。 解法:进行状态压缩, 用点+使用鞋子的次数 , 来表示一个状态 , d[i][k] , 表示到 ...
分类:其他好文   时间:2014-05-04 00:21:00    阅读次数:383
UVA 1372 - Log Jumping(推理)
题目链接:1372 - Log Jumping 题意:给定一些n个木板的起始位置和长度k,相重叠的木板可以互相跳跃,求能构成环的最大数量。 思路:先按起始位置排序,然后每次多一个木板就去判断他和前一个和前前一个能不能互相跳跃,如果可以的话就可以多加上这个木板。 代码: #include #include #include using namespace std; #define ma...
分类:其他好文   时间:2014-05-03 21:44:03    阅读次数:247
hdu 3594 Cactus /uva 10510 仙人掌图判定
仙人掌图(有向):同时满足:1强连通;2任何边不在俩个环中。 个人理解:其实就是环之间相连,两两只有一个公共点,(其实可以缩块),那个公共点是割点。HDU数据弱,网上很多错误代码和解法也可以过。 个人解法: 我认为:  :仙人掌图必然是欧拉图!这样只用“入度=出度”就可以简单地判断强连通(欧拉图显然强连通)了!而且这个必要(不充分)条件还秒杀好多数据(强连通++)。       个人证明...
分类:其他好文   时间:2014-05-03 21:38:39    阅读次数:250
UVA之11462 - Age Sort
【题目】 B Age Sort Input: Standard Input Output: Standard Output   You are given the ages (in years) of all people of a country with at least 1 year of age. You kn...
分类:其他好文   时间:2014-05-03 16:51:42    阅读次数:427
UVA之11549 - Calculator Conundrum
【题目】 Problem C CALCULATOR CONUNDRUM Alice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time waster. She enters a number k t...
分类:其他好文   时间:2014-05-03 15:37:03    阅读次数:308
UVA 之10010 - Where's Waldorf?
Where's Waldorf?  Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line o...
分类:其他好文   时间:2014-05-02 10:59:15    阅读次数:514
UVA 之401 - Palindromes
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from lef...
分类:其他好文   时间:2014-05-02 10:33:09    阅读次数:332
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!