摘要:
1 #include<iostream> 2 using namespace std; 3 int n; 4 int main() 5 { 6 int s[55]; 7 while(~scanf("%d",&n)&&n) 8 { 9 int i;10 s[0]=0;11 for(i=1;i<=4;i++)12 s[i]=i;13 s[5]=6;14 s[6]=9;15 s[7]=13;16 for(i=8;i<=54;i++)17 ... 阅读全文
摘要:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int T,a,b,i; 6 scanf("%d",&T); 7 while(T--) 8 { 9 scanf("%d %d",&a,&b);10 __int64 f0=1,f1=1,f;11 if(b-a==0||b-a==1)12 printf("1\n");13 else14 {15 for(i=2;i<... 阅读全文
摘要:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int N,M,i; 6 scanf("%d",&N); 7 while(N--) 8 { 9 scanf("%d",&M);10 __int64 f1=1,f2=1,f;11 if(M==1||M==2)12 printf("1\n");13 else14 {15 for(i=3;i<=M;i++)16 ... 阅读全文
摘要:
1 #include<iostream> 2 #include<queue> 3 using namespace std; 4 int map[51][51][51]; 5 int flag[51][51][51]; 6 int A,B,C,T; 7 int dir[][3]={{0,0,1},{0,1,0},{1,0,0},{0,0,-1},{0,-1,0},{-1,0,0}}; 8 struct node 9 {10 int x,y,z;11 int time;12 };13 void bfs()14 {15 int i;16 flag[0][0][0]=... 阅读全文
摘要:
1 #include<iostream> 2 using namespace std; 3 int step[21]; 4 int flag[21]; 5 int a[42]; 6 int n; 7 bool check(int x,int y) 8 { 9 if(a[x+y]&&!flag[y])10 return true;11 else12 return false;13 }14 void dfs(int dp)15 {16 int i;17 if(dp==n)18 {19 if(a[1+step[... 阅读全文
摘要:
1 #include<iostream> 2 using namespace std; 3 char str[200][100]; 4 int flag[200]; 5 int t,i; 6 void dfs(char temp) 7 { 8 int j; 9 if(temp=='m')10 {11 t=1;12 return;13 }14 for(j=0;j<i;j++)15 {16 if(str[j][0]==temp&&!flag[j])17 {18 ... 阅读全文