ZOJ Problem Set - 3792 Romantic Valuehttp://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5300模板题,有两种统计边数的办法,一种是扩大边权flow*=mod,然后加flow+=1,最后的最小割就...
分类:
其他好文 时间:
2014-08-26 13:38:26
阅读次数:
483
这道题的意思就是:2048游戏变成了只有一行的时候的玩法,可以向左合并。给你一串数字你可以选择一些加入队列,和为每个数的和,加上合并成的数字。
解题思路:如果一个序列可以合并那么它一定是降序的,比如:32,16,8,4否则的话,他是不能合并的此时的和就确定了。比如32, 32, 8,16.后面的16怎么合并都会比8大,所以是16之前的数字不可能继续合并下去。通过分析我们可以知道降序序列最多会有1...
分类:
其他好文 时间:
2014-08-26 11:47:55
阅读次数:
217
简单的dp。
dp[i][j]:在第i位置,递减的状态为j,所获得的最大利润。
枚举状态,如果加进来的数x比状态的最小的要大,那么直接状态变为x。
如果x比最小的要小,那么状态为j+x。
如果x等于最小的,那么依次加和,直至最小的比x大。
#include
#include
#include
#include
#include
#include
#include
#include
us...
分类:
其他好文 时间:
2014-08-26 11:39:45
阅读次数:
219
精确覆盖#include #include #include #include #include using namespace std;const int maxn=920;const int maxnode=920*550;const int maxr=550;int ans;struct DL...
分类:
其他好文 时间:
2014-08-26 09:44:25
阅读次数:
221
题目地址:ZOJ 2588
因为数组开小了而TLE了。。这题就是一个求无向连通图最小割边。只要判断dfn[u]是否
代码如下;
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
i...
分类:
其他好文 时间:
2014-08-26 00:36:15
阅读次数:
320
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3805
Machine
Time Limit: 2 Seconds Memory Limit: 65536 KB
In a typical assembly line, machines are connected one b...
分类:
其他好文 时间:
2014-08-25 21:17:04
阅读次数:
296
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3798
Abs Problem
Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge
Alice and Bob is playing a game, and ...
分类:
其他好文 时间:
2014-08-25 21:16:24
阅读次数:
293
ZOJ Monthly, August 2014 E题ZOJ月赛 2014年8月 E题http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5334Easy 2048 AgainTime Limit: 2 Seconds Memory ...
分类:
其他好文 时间:
2014-08-25 21:04:24
阅读次数:
233
学习:换一个角度考虑问题。YY's MinionsTime Limit: 2 Seconds Memory Limit: 65536 KBDespite YY's so much homework, she would like to take some time to play with her....
分类:
其他好文 时间:
2014-08-25 20:54:04
阅读次数:
309