上一页 1 ··· 37 38 39 40 41
摘要: 当成搜索题来做的, 直接搜肯定不行需要优化一下,权值打表就行了。 先搜索最少的,可以减少运算次数。 用二进制数表示某个数是否能用。 位运算还没写好 阅读全文
posted @ 2017-02-08 15:14 浪矢-CL 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 用二进制数的每个位代表某行中每个位上是否能用。 阅读全文
posted @ 2017-02-08 15:07 浪矢-CL 阅读(572) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; #define M 100000 char al[M],bl[M]; int a[M],b[M],c[M]; int longa,longb; void yawei() { int i,j,k=1; for( i=longa-1,j=1;i>=0;... 阅读全文
posted @ 2017-02-05 09:35 浪矢-CL 阅读(221) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; int n,m,v[999999],w[999999],ans=0; void dfs(int x,int y,int z) { if(x==n+1) if(y>m) return ; else {ans=max... 阅读全文
posted @ 2017-02-04 09:17 浪矢-CL 阅读(240) 评论(0) 推荐(0) 编辑
摘要: #define INF 9999999 int n,a[99999],dp[9999][9999],ans=9999999,s[9999]; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]),a[n+i]=a[i],s[i]=s[i-1]+a[i]; for(... 阅读全文
posted @ 2017-02-04 09:09 浪矢-CL 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #define INF 100099 2 int n,m,a[99999],s[99999],ans; 3 void dfs(int x,int y) 4 { 5 if(x==n+1) return; 6 else{ 7 if(a[x-1]<a[x]) s[x]=s[x-1]+1,dfs(x+1,s[x]); 8 ... 阅读全文
posted @ 2017-02-04 09:04 浪矢-CL 阅读(222) 评论(0) 推荐(0) 编辑
上一页 1 ··· 37 38 39 40 41