摘要:
http://poj.org/problem?id=1083哪个门前的走廊,被经过的次数最多,这个次数就是答案 1 #include <stdio.h> 2 3 int main() 4 { 5 int t, n, i, a, b, sum[432] = {0}, result; 6 scanf("%d", &t); 7 while(t-- && scanf("%d", &n)) 8 { 9 while(n-- && scanf("%d%d", &a, &b) 阅读全文
posted @ 2013-01-20 23:55
Yuan1991
阅读(130)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=1189DP,“数塔” 1 #include <stdio.h> 2 #include <string.h> 3 4 int a[56][56]; 5 long long dp[56][56]; 6 7 long long gcd(long long x, long long y) 8 { 9 return y? gcd(y, x%y): x;10 }11 12 13 int main()14 {15 int i, j, k, n, m;16 long long r;17 char s[1234] = "\. 阅读全文
posted @ 2013-01-20 23:52
Yuan1991
阅读(148)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=1018DP,写的好蒙。。。 1 #include <stdio.h> 2 #include <map> 3 4 using namespace std; 5 6 #define N 110 7 8 int b[N][N], p[N][N]; 9 int dp[N][N*N];10 const int maxint = 1<<30;11 12 int main()13 {14 int i, j, t, n, m, x, y, k;15 float max1, temp1;16 map<int, int 阅读全文
posted @ 2013-01-20 23:51
Yuan1991
阅读(132)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=1065DP,最长“上升”子序列 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 struct Sticks 5 { 6 int x, y; 7 }s[5432]; 8 9 int n, dp[5432];10 11 int cmp1(struct Sticks a, struct Sticks b)12 {13 return a.x < b.x || a.y < b.y;14 }15 16 int LIS()17 {18 int i, j, max1, max 阅读全文
posted @ 2013-01-20 01:09
Yuan1991
阅读(136)
评论(0)
推荐(0)

浙公网安备 33010602011771号