BZOJ2102 : [Usaco2010 Dec]The Trough Game】的更多相关文章

暴力枚举答案然后检验. #include<cstdio> int n,m,i,j,k,a[100],b[100],cnt,ans;char s[20]; int main(){ for(scanf("%d%d",&n,&m);i<m;i++)for(scanf("%s%d",s,&b[i]),j=0;j<n;j++)if(s[j]=='1')a[i]|=1<<j; for(i=0;i<(1<&l…
2102: [Usaco2010 Dec]The Trough Game Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 117  Solved: 84[Submit][Status] Description Farmer John and Bessie are playing games again. This one has to do with troughs of water. Farmer John has hidden N (1 <= N…
http://www.lydsy.com/JudgeOnline/problem.php?id=2102 直接枚举所有情况......然后判断是否可行.. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include <queue> using…
我猜我这样继续做水题会狗带 和模拟赛的题很像,贪心搞一下. #include<bits/stdc++.h> using namespace std; int read(){ ,f=;char ch=getchar(); ;ch=getchar();} +ch-';ch=getchar();} return x*f; } #define N 100005 int n,m,f[N],q[N],cnt; struct Node{ int to,next; }e[N<<]; int tot…
2101: [Usaco2010 Dec]Treasure Chest 藏宝箱 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 327  Solved: 147[Submit][Status] Description Bessie and Bonnie have found a treasure chest full of marvelous gold coins! Being cows, though, they can't just walk i…
跑两遍最短路就好了.. 话说这翻译2333 ---------------------------------------------------------------------- #include<cstdio> #include<queue> #include<algorithm> #include<cstring> #include<iostream>   #define rep( i , n ) for( int i = 0 ; i…
dp( l , r ) = sum( l , r ) - min( dp( l + 1 , r ) , dp( l , r - 1 ) ) 被卡空间....我们可以发现 l > r 是无意义的 , 所以可以省下一半的空间 -------------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<a…
BZOJ_2097_[Usaco2010 Dec]Exercise 奶牛健美操_二分答案+树形DP Description Farmer John为了保持奶牛们的健康,让可怜的奶牛们不停在牧场之间 的小路上奔跑.这些奶牛的路径集合可以被表示成一个点集和一些连接 两个顶点的双向路,使得每对点之间恰好有一条简单路径.简单的说来, 这些点的布局就是一棵树,且每条边等长,都为1. 对于给定的一个奶牛路径集合,精明的奶牛们会计算出任意点对路径的最大值, 我们称之为这个路径集合的直径.如果直径太大,奶牛们就…
2101: [Usaco2010 Dec]Treasure Chest 藏宝箱 Time Limit: 10 Sec  Memory Limit: 64 MB Submit: 418  Solved: 206 [Submit][Status][Discuss] Description Bessie and Bonnie have found a treasure chest full of marvelous gold coins! Being cows, though, they can't…
BZOJ_2099_[Usaco2010 Dec]Letter 恐吓信_后缀自动机 Description FJ刚刚和邻居发生了一场可怕的争吵,他咽不下这口气,决定佚名发给他的邻居 一封脏话连篇的信.他有无限张完全相同的已经打印好的信件,都包含 N个字母(1 <= N <= 50,000).他想剪出其中一些并且粘帖成一个很长的字母串. FJ太懒了,他想用最少的次数裁剪信件.他有一把举世无双的剪刀,他可以从 一封信中只剪一刀剪出连续一段.同样,剪一刀可以得到整个完整的字符串. 他想知道他最少需要…