摘要: 略坑啊,题目保证答案小于maxlongint,结果我开int64才过。题目描述很含糊。大概是求某一条边最多能同时出现在几条路径上。两次DP解决,而且题目说“每一条道路都由编号较小的路口通向编号较大的路口”,所以不用拓扑排序。 1: program bzoj1638; 2: uses math; 3: const maxn=50000;maxm=500000; 4: var u,tot,n... 阅读全文
posted @ 2012-11-01 17:09 ljlin 阅读(256) 评论(0) 推荐(1)
摘要: 做模拟赛受虐了,切usaco玩。 1: program bzoj1609; 2: uses math; 3: const maxn=30000; 4: var i,n,ans:longint; 5: f:array[0..maxn,1..3] of longint; 6: D:array[0..maxn] of longint; 7: procedure swap... 阅读全文
posted @ 2012-11-01 00:42 ljlin 阅读(355) 评论(0) 推荐(0)
摘要: 做模拟赛受虐,切usaco玩。 1: program bzoj1617; 2: uses math; 3: const maxn=2500; 4: var f,cost:array[0..maxn] of longint; 5: n,i,j:longint; 6: begin 7: filldword(f,sizeof(f)>>2,maxlongint); 8: ... 阅读全文
posted @ 2012-11-01 00:37 ljlin 阅读(205) 评论(0) 推荐(0)