上一页 1 ··· 48 49 50 51 52
摘要: http://poj.org/problem?id=1753 1 #include 2 #include 3 #include 4 using namespace std; 5 6 char s[6][6]; 7 int a[6][6]; 8 int deep,step,flag; 9 void inti(int row,int c)10 {11 a[row-1][c]=!a[row-1][c];12 a[row][c+1]=!a[row][c+1];13 a[row+1][c]=!a[row+1][c];14 a[row][c-1]=!a[row][c-1]... 阅读全文
posted @ 2013-08-02 16:15 null1019 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 地址:http://poj.org/problem?id=2506递推公式::f[x]=f[x-1]+f[x-2]*2需要用到大数。 1 #include 2 #include 3 #define max 100 4 int f[500][max]; 5 int h[max]; 6 int main() 7 { 8 int n,j; 9 while(scanf("%d",&n)!=EOF)10 {11 if(n==0) {printf("1\n");continue;}12 memset(f,0,sizeof(f));13 ... 阅读全文
posted @ 2013-08-01 21:32 null1019 阅读(217) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2482&cid=1184 1 #include 2 #include 3 #include 4 using namespace std; 5 typedef struct node 6 { 7 char data; 8 struct node *l,*r; 9 } treenode,*tree;10 char s[30],s1[30],s2[30];11 int c=0;12 int insert(tree *t,char x)13 {14 t... 阅读全文
posted @ 2013-07-29 16:09 null1019 阅读(141) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2484&cid=1182写的代码很复杂先转换成后缀式再建立表达式树 1 #include 2 #include 3 #include 4 5 #define MAXN 100 6 int comp(char a, char b) 7 { 8 if(a == '(') return 0; 9 if(a=='*' || a=='/') return 1; 10 else if((a=='+' || a=='-' 阅读全文
posted @ 2013-07-29 15:11 null1019 阅读(217) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1265 1 #include 2 #include 3 #include 4 #include 5 int n; 6 using namespace std; 7 const int maxn=100; 8 const double pi=acos(-1.0); 9 int gcd(int a,int b)10 {11 return b==0?a:gcd(b,a%b);12 }13 struct Point //点的定义14 {15 double x,y;16 Point() {}17 Point (dou... 阅读全文
posted @ 2013-07-29 10:52 null1019 阅读(207) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3278 1 Source Code 2 3 Problem: 3278 User: SDUT_NULL 4 Memory: 1068K Time: 63MS 5 Language: G++ Result: Accepted 6 7 Source Code 8 #include 9 #include10 #include11 #include12 #include13 bool s[200010];14 using namespace std;15 struct node16 {17 int num;18 i... 阅读全文
posted @ 2013-07-29 10:50 null1019 阅读(218) 评论(1) 推荐(1) 编辑
上一页 1 ··· 48 49 50 51 52