02 2013 档案
摘要:1 #include<stdio.h> 2 #include<string.h> 3 4 int map[10][10],sum,n,m,vis[10][10]; 5 6 void seek(int mbn,int mbm) 7 { 8 int jn[] = {0,0,-1,1}; 9 int jm[] = {-1,1,0,0}; 10 int i,tn,tm; 11 for(i = 0;i < 4; i++) 12 { 13 tn = mbn+jn[i]; 14 tm = ...
阅读全文
摘要:1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 int n,h[1010]; 6 7 struct M 8 { 9 int data;10 struct M *next;11 }*head[1010];12 13 struct Q14 {15 int step;16 int site;17 };18 19 void init()20 {21 int i;22 for(i = 1;i <= n; i++)23 {24 head[i] =...
阅读全文
摘要:#include<stdio.h>#include<string.h>intmark,k,m,map[101][101],vis[101][101],h[105];voidseek(intmb){if(h[mb])return;elseh[mb]=1;inti,j;if(mark){printf("%d",mb);mark=0;}elseprintf("%d",mb);for(i=1;i<k;i++){if((map[i][mb]&&!vis[i][mb])||(map[mb][i]&&!vi
阅读全文
摘要:#include<stdio.h>#include<string.h>int mark,k,m,map[101][101],vis[101][101],h[105];void seek(int mb){ int q[100],i,s,e; s = e =0; q[e++] = mb; while(s < e) { mb = q[s++]; if(mark) { mark = 0; printf("%d",mb); } else printf(" %d"...
阅读全文
摘要:#include<stdio.h>#include<stdlib.h>#include<string.h>int k,h[110],mark;struct M{ int data; struct M *next;}*head[110];void init(){ int i; for(i = 0; i < k; i++) { head[i] = (struct M *)malloc(sizeof(struct M)); head[i]->next = NULL; head[i]->data = -1; }}void l...
阅读全文
摘要:#include<string.h>#include<stdio.h>int a,b,c,pos[52][52][52];struct POS{ int x,y,z;} q[125110];int bfs(){ int s,e,i; struct POS temp,t; int jx[] = {0,0,0,0,1,-1}; int jy[] = {0,0,-1,1,0,0}; int jz[] = {-1,1,0,0,0,0}; s = e = 0; q[e].x = q[e].y = q[e].z = 0; e++; while(s...
阅读全文
摘要:#include<stdio.h>#include<string.h>int main(){ int i,j,js,s[1000],a[1000],b[1000]; while(~scanf("%d",&js)) { for(i = 0;i < js; i++) scanf("%d",&s[i]); a[0] = 1; int m = 0; for(i = 1;i < js; i++,m = 0) { for(j = 0;j < i; j++) ...
阅读全文