![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
取竹
Hai capito?
展开
-
[bzoj] 1082: [SCOI2005]栅栏
预处理掉无用状态,二分查找可以切出多少木板。dfs搜索可行性,加上剪枝优化。 #include #include using namespace std; int n,m,tot,ans,l,r,mid; int a[55],b[1005],sl[1005],bl[1005]; bool f; long long sum; void dfs(int ak,int bk,int w) {原创 2017-05-23 21:16:57 · 243 阅读 · 0 评论 -
[bzoj]1024: [SCOI2009]生日快乐
直接暴力求答案,听说标准解法是二分最小值? #include #include using namespace std; int x,y,n; double dfs(double x,double y,int n) { register int i; if (n==1) return (x>y)?(x/y):(y/x); double ans=100000; for (i=1;i<=原创 2017-06-03 19:19:08 · 192 阅读 · 0 评论 -
[bzoj]1603: [Usaco2008 Oct]打谷机
直接暴力dfs搞出解就行了。。。 #include using namespace std; const int N=1005; int n,cnt=1; struct node { int from,to,w,nxt; }edge[N<<1]; int head[N]; inline void add(int from,int to,int w) { edge[cnt原创 2017-06-14 21:09:59 · 249 阅读 · 0 评论