2012年7月26日
摘要: 还是水题,不过我承认代码写的很烂……下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:concom 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 int control[101][101];12 int state[101][101];13 int sum[101];14 int main()15 阅读全文
posted @ 2012-07-26 23:01 醉春雨 阅读(135) 评论(0) 推荐(0)
摘要: 题目蛮简单,就是写起来蛮麻烦,可能有更好的写法。下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:zerosum 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 char formula[20];13 14 bool caculate(int n)15 {16 int result=0,i,nu 阅读全文
posted @ 2012-07-26 10:26 醉春雨 阅读(137) 评论(0) 推荐(0)
  2012年7月25日
摘要: 坑爹!首先吐槽下,错了一个符号调试了我一个晚上!!然后想说DP方程有时候真不容易想出来…………下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:nocows 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 int kind[200][100];13 int work(int n,int h)14 阅读全文
posted @ 2012-07-25 21:27 醉春雨 阅读(210) 评论(0) 推荐(0)
  2012年7月23日
摘要: 本来是蛮简单的题,但是没想到要按大小排序……所以取了点巧。有空会再研究下更好的方法。因为只可能有16种可能,所以枚举就可以了。下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:lamps 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h> 10 using namespace std; 11 12 bool lamb[110]; 13 int off[1 阅读全文
posted @ 2012-07-23 16:37 醉春雨 阅读(128) 评论(0) 推荐(0)
摘要: 蛮简单的题,直接枚举就行了,稍微剪枝,注意数字不能重复出现并且没有0.下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:runround 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 13 int move(char *fin,int n,int len)14 {15 switch(fin[n 阅读全文
posted @ 2012-07-23 11:15 醉春雨 阅读(137) 评论(0) 推荐(0)
摘要: 这道题看起来蛮简单,却花费我不少时间,看来功夫还是不够啊。深搜超时、递归也超时,DP才能过,现在对DP理解更深了一次额。下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:subset 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 int dp[40][800];13 int sum[40];1 阅读全文
posted @ 2012-07-23 09:23 醉春雨 阅读(109) 评论(0) 推荐(0)
  2012年7月22日
摘要: 题目蛮简单,不过代码写的有点长,可能有更好的方法……下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:preface 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h> 10 using namespace std; 11 12 void t(int n,char ch[20]) 13 { 14 int i=0; 15 while(n!=0) 16 { 阅读全文
posted @ 2012-07-22 11:40 醉春雨 阅读(141) 评论(0) 推荐(0)
摘要: 简单题,感觉很久没做过这么简单的题了。最小的数肯定是0,接下来枚举就行了。下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:hamming 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 int bitnum(int n)13 {14 int i=0;15 while(n!=0)16 {17 n 阅读全文
posted @ 2012-07-22 10:26 醉春雨 阅读(160) 评论(0) 推荐(0)
  2012年7月21日
摘要: 这是用dfs写出来的,照样调试用了很多时间,有待加强啊!!下面贴出代码,以作纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:holstein 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 int scoop[15][25];13 int vitamin[25];14 int minn;15 int order 阅读全文
posted @ 2012-07-21 21:02 醉春雨 阅读(129) 评论(0) 推荐(0)
摘要: 悲剧啊!这么简单的题想了一天愣是没想到,枚举就可以了…………dfs也可以,回去再写一遍。深刻的教训!!下面贴出代码,匆忙写出来的,没有优化代码,做个纪念。View Code 1 /*{ 2 ID:jzy3209981 3 PROG:holstein 4 LANG:C++ 5 }*/ 6 #include<stdio.h> 7 #include<iostream> 8 #include<string.h> 9 #include<math.h>10 using namespace std;11 12 int scoop[15][25];13 int 阅读全文
posted @ 2012-07-21 16:40 醉春雨 阅读(118) 评论(0) 推荐(0)