码迷,mamicode.com
首页 >  
搜索关键字:zoj 2913    ( 3447个结果
ZOJ - 1093 Monkey and Banana
DAG嵌套模型,状态方程由1改成高度就行。 1 #include 2 #include 3 #include 4 #define doumax(a,b) (a>b?a:b) 5 const int maxn=100; 6 int mat[maxn][maxn],dp[maxn],n,a[35][5]...
分类:其他好文   时间:2014-07-19 15:04:56    阅读次数:234
ZOJ - 1709 Oil Deposits
油田问题,有点像图像处理里的区域生长问题,找油田块数。BFS,DFS都可以。 1 /*BFS*/ 2 #include 3 #include 4 const int maxn=100+5,maxm=1000; 5 int m,n,vis[maxn][maxn],mat[maxn][maxn],dir...
分类:其他好文   时间:2014-07-18 16:19:41    阅读次数:267
ZOJ - 2165 Red and Black
BFS题,只是没有目标位置,只需记下走过的黑色的块数就行 1 #include 2 #include 3 const int maxn=1000,maxm=25; 4 int vis[maxm][maxm],mat[maxm][maxm],dir[5][3]={{1,0},{0,-1},{-1,0}...
分类:其他好文   时间:2014-07-18 16:12:09    阅读次数:267
ZOJ 3967 Colorful Rainbows --栈的应用
题意:给出n条y=ai*x+bi的直线。对于这些直线,如果存在x使得该直线y大于其他任意一直线,那么这条直线可以被看见,问有多少条直线可以被看见。做法什么的不讲了,参见:http://blog.csdn.net/ten_three/article/details/12289427 以及 http:/...
分类:其他好文   时间:2014-07-18 15:19:12    阅读次数:413
Poj 1144 Zoj 1311 求割点 模板
写这个就是为了手写一份好用的求割点模板: 吐槽下,题目中的 Each of the next at most N lines contains the number of a place followed by the numbers of some places to which there is a direct line from this place.  这个at most是不可信的,应...
分类:其他好文   时间:2014-07-18 11:29:34    阅读次数:232
ZOJ 1232 Adventure of Super Mario
最短路+DP(个人用的SPFA+完全背包) 做了一上午……开始想用SPFA+BFS。但是写了半天越写越乱,放弃了。 就想到了是不是可以当作背包问题(背出病了……)把鞋子可以使用的次数当作背包容量。做完全背包。 先N次SPFA把 各点的最短距离算出来,其实比较适合Floyd。(个人用vector实现伪邻接表,然后SPFA) 然后SPFA更新路径的时候,当鞋子使用次数不...
分类:其他好文   时间:2014-07-18 11:18:36    阅读次数:279
ZOJ - 1008 Gnome Tetravex
DFS题,类似八皇后问题,题目有点长,看了老半天才看懂。特别是上下左右数字要注意。还要注意剪枝,另外空行不能多输,输多了不能AC(运行速度有点慢,能AC但1940ms,估计还有待优化) 1 #include 2 #include 3 const int maxn=25+5; 4 int num[ma...
分类:其他好文   时间:2014-07-18 09:24:14    阅读次数:213
ZOJ 2975 Kinds of Fuwas
K - Kinds of Fuwas Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionIn the year 2008, the 29th Olympic Games will be held ...
分类:其他好文   时间:2014-07-18 00:19:24    阅读次数:357
ZOJ 2969 Easy Task
E - Easy TaskDescriptionCalculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivation. W...
分类:其他好文   时间:2014-07-18 00:15:29    阅读次数:262
ZOJ 2970 Faster, Higher, Stronger
F - Faster, Higher, Stronger Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice ZOJ 2970DescriptionIn the year 2...
分类:其他好文   时间:2014-07-18 00:05:06    阅读次数:253
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!