摘要:
本来是蛮简单的题,但是没想到要按大小排序……所以取了点巧。有空会再研究下更好的方法。因为只可能有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)
浙公网安备 33010602011771号