// 20084t.c
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
int check2(int t[N][M],int x, int y, int d){
t[x][y]=0;
if(t[x-1][y]==1){
check2(t,x-1,y,d+1);
}
if(t[x+1][y]==1){
check2(t,x+1,y,d+1);
}
if(t[x][y+1]==1){
check2(t,x,y+1,d+1);
}
if(t[x][y-1]==1){
check2(t,x,y-1,d+1);
}
t[x][y]=1;
if((t[x][y+1]||t[x][y-1]||t[x+1][y]||t[x-1][y])==0){
if(d+1 > max_d){
max_d=d+1;
}
return(0);
}
int main()
{
return 0;
}
// main 関数は正常に終了したとき return 0;
// エラーが発生したときは、0 以外の数値を返すように
// する習慣があるようですので、以降は return 0; に
// 統一しましょう
最終更新:2009年11月24日 01:53