码迷,mamicode.com
首页 >  
搜索关键字:uva 321    ( 8022个结果
UVA - 12001 UVa Panel Discussion
Description   UVa Panel Discussion  The UVa online judge team is arranging a panel discussion for the next ACM-ICPC World Finals event in Orlando, Florida. They want that three...
分类:其他好文   时间:2014-08-16 16:31:00    阅读次数:204
可持久化并查集的两种实现
对于像UVA 11987 Almost Union-Find这样的题目,要求把一个元素从一个集合中剥离的情况,我们只需要新建一个节点然后………. 还是看代码吧: inline void move(int x,int y) // 把x从y集合中剥离{ int fx = find(id[x]),fy =...
分类:其他好文   时间:2014-08-16 14:58:50    阅读次数:231
UVA - 12294 RPG battles
Description   RPG battles  In many typical RPG games, you battle with bad guys, creatures, monsters or ghosts etc. all the time. After each battle, you may get magic potions th...
分类:其他好文   时间:2014-08-16 13:51:30    阅读次数:245
UVA - 12295 Optimal Symmetric Paths (递推)
Description   Optimal Symmetric Paths  You have a grid of n rows and n columns. Each of the unit squares contains a non-zero digit. You walk from the top-left square to the b...
分类:其他好文   时间:2014-08-16 12:36:50    阅读次数:332
UVA - 10118Free Candies(记忆化搜索)
题目:UVA - 10118Free Candies(记忆化搜索) 题目大意:给你四堆糖果,每个糖果都有颜色。每次你都只能拿任意一堆最上面的糖果,放到自己的篮子里。如果有两个糖果颜色相同的话,就可以将这对糖果放进自己的口袋。自己的篮子最多只能装5个糖果,如果满了,游戏就结束了。问你能够得到的最多的糖果对数。 解题思路:这题想了好久,好不容易把状态想对了,结果脑子发热,又偏离了方...
分类:其他好文   时间:2014-08-16 01:05:29    阅读次数:274
UVA - 825Walking on the Safe Side(dp)
题目: UVA - 825Walking on the Safe Side(dp) 题目大意:给出一个n * m的矩阵,起点是1 * 1,终点是n * m,这个矩阵上有些点是不可以经过的,要求从起点到终点距离最短,并且不能走那种不能走的点,一共有多少种方式。 解题思路:要求路径最短的话,每个点要不向右走,要不向下走。dp【i】【j】 = dp【i】【j + 1】 + dp【i ...
分类:其他好文   时间:2014-08-15 23:50:49    阅读次数:423
【UVA】1210 - Sum of Consecutive Prime Numbers
普通的求区间连续和的问题,一开始因为是区间移动,但是怕UVA数据太严,直接打表,后来发现自己的担心是多余的。 14044972 1210 Sum of Consecutive Prime Numbers Accepted C++ 0.049 2014-08-15 10:30:11 打表的话效率可能不是很高. AC代码:...
分类:其他好文   时间:2014-08-15 19:43:29    阅读次数:182
UVA 1493 - Draw a Mess(并查集)
UVA 1493 - Draw a Mess 题目链接 题意:在一个n*m平面上,有4种操作,对应把相应区域颜色涂成v(1 思路:并查集,由于颜色涂上去会覆盖,这样我们就可以反向执行操作,这样保证每次操作如果之前有颜色就不能涂,如果没有就可以涂,然后一共有200行,每行都利用并查集压缩路径,查找下一个能涂色的位置即可 题目中说三角形边一定是奇数,可居然有偶数的。。。被这个坑...
分类:其他好文   时间:2014-08-15 19:42:03    阅读次数:299
UVA 725 Division ( 找出 abcde / fghij = N的形式—— 暴力枚举 )
A - Division Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Description   Division  Write a program that finds and displa...
分类:其他好文   时间:2014-08-15 18:02:29    阅读次数:232
UVA 11582 Colossal Fibonacci Numbers!(打表+快速幂)
Colossal Fibonacci Numbers! The i'th Fibonacci number f (i) is recursively defined in the following way: f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i)  for every i ≥ 0 Your task is to comput...
分类:其他好文   时间:2014-08-15 17:55:09    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!