码迷,mamicode.com
首页 >  
搜索关键字:treasure hunting    ( 289个结果
ZOJ-3626 Treasure Hunt I 树形DP
很久很久以前有一个吸血鬼,每m天就会出现一次,把不在自己村子呆着的冒险家吃掉。有n个村子,n-1条道路,每个村子都有一定数量的财富,默认探险家刚一到达一个村子就能获得财富,给出探险家的出生的村子和多少天后吸血鬼出现。 要求在吸血鬼出现之前赶回自己的村子,其实就是求一棵以k为根的各点权值之和最大且各边权加起来 #include #include #include #include #in...
分类:其他好文   时间:2014-08-29 16:07:48    阅读次数:214
zoj3629 Treasure Hunt IV
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3629 思路:找规律,发现符合要求的数为 [0,1) [4,9) [16,25) [36,49) ………… [n^2 , (n+1)^2) 发现 n^2 到(n+1)^2(n为偶数)前开后闭的区间为符合要求的数,然后发现(n+1)*(n+1)-n*n...
分类:其他好文   时间:2014-08-28 22:49:06    阅读次数:311
POJ 2594 Treasure Exploration【传递闭包+最小路径覆盖】
大意:有n个点,告诉你一些单向边,问多少条边能把所有的点覆盖【注意点能重复覆盖 比如4->1->2 5->3】分析:知识储备:传递闭包: 所谓传递,可以这么理解,对于节点j如果i能到k并且k能到j那么i能到j,这样用像floyed就能处理出任意两个点能否到达for(int k = 1; k 2 .....
分类:其他好文   时间:2014-08-27 23:09:48    阅读次数:339
zoj 3627#模拟#枚举
Treasure Hunt IITime Limit: 2 Seconds Memory Limit: 65536 KBThere are n cities(1, 2, ... ,n) forming a line on the wonderland. city i and city i+1 ...
分类:其他好文   时间:2014-08-26 21:26:16    阅读次数:531
zoj 3209 Treasure Map(精确覆盖)
Treasure MapTime Limit:2 Seconds Memory Limit:32768 KBYour boss once had got many copies of a treasure map. Unfortunately, all the copies are now brok...
分类:其他好文   时间:2014-08-19 18:26:35    阅读次数:284
zoj 3626 Treasure Hunt I (树形dp)
题目大意: 给出一棵树,求出从起点开始走m长度最后回到起点,所能得到的宝藏的最大价值。 思路分析: 通过一次dfs可以得到的是子树到根节点的所有距离的最大值。 现在的问题就是他走完一颗子树可以去另外一颗子树。 所以在回溯到根的时候要统计其他子树上互补距离的最大值。 dp[i] [j] 表示i为根节点,在i的子树中走j步然后回到i所能拿到的最大价值。 转移方程就是 d...
分类:其他好文   时间:2014-08-19 10:59:44    阅读次数:250
[zoj 3626]Treasure Hunt I 树DP
Treasure Hunt I Time Limit: 2 Seconds      Memory Limit: 65536 KB Akiba is a dangerous country since a bloodsucker living there. Sometimes the bloodsucker will appear and kill everyone who isn't...
分类:其他好文   时间:2014-08-14 10:49:38    阅读次数:266
你珍惜一个人,一定是感动过
Don't forget the things you once owned. Treasure the things you can't get. Don't give up the things that belong to you and keep those lost things in m...
分类:其他好文   时间:2014-08-13 17:55:06    阅读次数:220
最后一周训练赛第一题
A -Problem ATime Limit:2000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeSPOJ QUEST5DescriptionTo get to the treasure,Jonesmust com...
分类:其他好文   时间:2014-08-11 17:40:52    阅读次数:235
训练赛(1---5)A
一、题目DescriptionTo get to the treasure,Jonesmust complete one more task. He comes across a table, where there are a number of wooden planks lying along...
分类:其他好文   时间:2014-08-11 17:34:22    阅读次数:228
289条   上一页 1 ... 25 26 27 28 29 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!