码迷,mamicode.com
首页 >  
搜索关键字:dining cows    ( 1679个结果
POJ2184---Cow Exhibition(01背包变形)
Description “Fat and docile, big and dumb, they look so stupid, they aren’t much fun…” - Cows with Guns by Dana LyonsThe cows want to prove to the public that they are both smart and fun. In order t...
分类:其他好文   时间:2015-04-21 22:51:44    阅读次数:185
(最优比率环) poj3621
Sightseeing CowsTime Limit:1000MSMemory Limit:65536KTotal Submissions:8197Accepted:2750DescriptionFarmer John has decided to reward his cows for their...
分类:其他好文   时间:2015-04-19 21:09:15    阅读次数:184
Poj 3667 Hotel 【线段树最左空区间】
HotelTime Limit: 3000MS Memory Limit: 65536K Total Submissions: 13034 Accepted: 5606 DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacati...
分类:其他好文   时间:2015-04-18 14:35:37    阅读次数:157
POJ 2186 Popular Cows(初学强连通)
题意:有n个牛,m个有向“仰慕”关系,关系可传递,求多少个牛被所有牛都“仰慕” 思路:显然被所有牛仰慕的牛群是一强连通分量 所以先把乱图缩点成有向无环图 对有向无环图有这个重要结论: 任何连通的图都至少有一个入度为0的点和至少有一个出度为0的点(也就是至少有一个最高强连通分量和一个最低强连通分量) 所以本题是找连通图的唯一的最低强连通分量,显然仅有一个出度为0的强连通分量...
分类:其他好文   时间:2015-04-17 22:27:01    阅读次数:201
poj 3621 Sightseeing Cows 负环探测解参数搜索
题意: 有向图中每个点有一个欢乐值,边有边权,要求一条环路,使环路上欢乐值得和/路径和最大。 分析: 二分参数,判断是否存在负权,这里判负圈没用spfa,用的是一种效率很高的方法。 代码: //poj 3621 //sep9 #include #include using namespace std; const int maxN=1024; const int maxM=5012;...
分类:其他好文   时间:2015-04-17 11:35:23    阅读次数:196
[POJ 3270] Cow Sorting
Cow SortingTime Limit:2000MSMemory Limit:65536KTotal Submissions:6287Accepted:2429DescriptionFarmer John'sN(1 ≤N≤ 10,000) cows are lined up to be milk...
分类:其他好文   时间:2015-04-16 01:06:13    阅读次数:168
(贪心) poj 1989
The Cow LineupTime Limit:1000MSMemory Limit:30000KTotal Submissions:5342Accepted:3184DescriptionFarmer John's N cows (1 #include#include#include#inclu...
分类:其他好文   时间:2015-04-15 22:55:12    阅读次数:142
POJ 2456 Aggressive cows
#include #include #include #include #include using namespace std; #define maxn 100000 int n, m, x[maxn]; int Max; bool judge(int d) { int cnt = 1; int a = x[0]; for(int i=1; i<n; i...
分类:其他好文   时间:2015-04-15 17:03:27    阅读次数:120
【BZOJ 2060】 [Usaco2010 Nov]Visiting Cows 拜访奶牛
树形dp~...
分类:其他好文   时间:2015-04-15 11:29:07    阅读次数:195
POJ 3671 Dining Cows (DP)
题目大意:给你一串只有1,2的数字,让你改变最少的次数,让这个序列变成非递减的。 思路:动态规划,判断分界点,开一个dp[30010][2]的数组,其中dp[i][j]表示把第i个数改成j最少要花多少次 那么状态转移方程就列出来了: 令a=1 j!=a[i] 0 j==a[i] 那么dp[i][1]=dp[i-1][1]+a; dp[i][2]=min(dp[i-1][1],dp[i-...
分类:其他好文   时间:2015-04-14 21:37:01    阅读次数:137
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!