摘要: /* TASK: milk3 LANG: C++ SOLVE: 倒水,dfs,枚举每一种倒法,ca[i][j]记录a和c桶的状态,因为总体积不变,故b的状态不需要记录。 */ #include #include #include #include using namespace std; int a,b,c; bool ca[30][30]; void dfs(int na,int nb,in... 阅读全文
posted @ 2016-09-28 17:26 水郁 阅读(334) 评论(2) 推荐(0) 编辑
摘要: /* TASK: ariprog LANG:C++ URL:http://train.usaco.org/usacoprob2?a=PA9lOcZrdWq&S=ariprog SOLVE:平方和最大为m*m*2,因此bq数组标记数i是否为平方和数,num数组存第i个平方和数 枚举公差q,从1到num[tol]/(n-1),枚举起点p,从num[1]到num[tol-1] 判断数p+i*q是否为平... 阅读全文
posted @ 2016-09-28 14:44 水郁 阅读(348) 评论(0) 推荐(0) 编辑
……