摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1081 1 #include 2 #include 3 #include 4 #define maxn 300 5 using namespace std; 6 const int inf=0x7fffffff; 7 8 int dp[maxn][maxn]; 9 int a[maxn][maxn];10 11 int main()12 {13 int n;14 while(scanf("%d",&n)!=EOF)15 {16 for(int i=1; i<=n... 阅读全文
posted @ 2014-04-04 20:50 null1019 阅读(91) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1559 1 #include 2 #include 3 #include 4 #define maxn 1001 5 using namespace std; 6 7 int b[maxn][maxn]; 8 int a[maxn][maxn]; 9 int dp[maxn];10 int n,m,x,y;11 12 int main()13 {14 int t;15 scanf("%d",&t);16 while(t--)17 {18 scanf("%... 阅读全文
posted @ 2014-04-04 20:37 null1019 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 这道题看着别人的代码写的。 1 #include 2 #include 3 #define m 1000000009 4 using namespace std; 5 6 bool prime[10][10][10]; 7 int dp[10001][10][10]; 8 int temp=0; 9 10 11 void getprime()12 {13 memset(dp,0,sizeodp(dp));14 bool p[1000];15 memset(p,false,sizeof(p));16 for(int i=2; i0&&(prime[x1][x... 阅读全文
posted @ 2014-04-04 19:34 null1019 阅读(125) 评论(0) 推荐(0) 编辑