摘要:
http://poj.org/problem?id=3668水题,STL 1 #include 2 #include 3 4 using namespace std; 5 6 set > set1; 7 8 int gcd(int x, int y) 9 {10 return y? gcd(y, x%y): x;11 }12 13 int abs(int x)14 {15 return x<0? -1*x: x;16 }17 18 struct P19 {20 int x, y;21 }p[1234];22 23 int main()24 {25 in... 阅读全文
摘要:
http://poj.org/problem?id=3670DP,最长不降子序列,O(n*logn)解法 1 #include 2 #define N 30030 3 4 int n, a[N], dp[N]; 5 const int maxint = (1>1;13 if(dp[m] maxn)35 {36 maxn ++;37 dp[maxn+1] = maxint;38 }39 }40 return maxn;41 }42 43 int main()44 {45 ... 阅读全文