10 2013 档案

摘要:Make Palindrome大意:求一个字符串在通过在任意位置增加一个字符使得变为一个回文串的最小操作数及打印出该回文串。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 int dp[1010][1010];12 13 int Max(int x, int y)14 {15 if(x >= y)16 return x;17 return y;18 }19 20 ... 阅读全文
posted @ 2013-10-29 19:18 GLSilence 阅读(215) 评论(0) 推荐(0)
摘要:Bad Hair Day开个标记数组记录,记录右边第一个比它大的位置。#include #include #define N 80001long long p[N],left[N],sum;int main(){ int n,i,j; scanf("%d",&n); for(i = 1; i = 1; i--) { j = i+1; while(j #include using namespace std;const int N = 80005;int stack[N];int top, n;int main(){ int num; ... 阅读全文
posted @ 2013-10-24 21:35 GLSilence 阅读(256) 评论(0) 推荐(0)
摘要:因式分解# include # include # include # include # include # include # include # include using namespace std;int a[100000010];int b[100000010];void run(){ int t, num, q, n; scanf("%d", &n); t = sqrt(n); num = 0; for(int i = 2; i = 1; i--) { num++; a[num] = n/a[i]; } ... 阅读全文
posted @ 2013-10-22 20:54 GLSilence 阅读(240) 评论(0) 推荐(0)
摘要:struct node{ char data[100];} s[100010];bool cmp(const node &x, const node &y){ if(strcmp(x.data, y.data) < 0) return true; return false;}sort(s, s+n, cmp); 阅读全文
posted @ 2013-10-22 20:01 GLSilence 阅读(337) 评论(0) 推荐(0)