Cod sursa(job #37918)

Utilizator megabyteBarsan Paul megabyte Data 25 martie 2007 13:04:08
Problema Regiuni Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.26 kb
#include <cstdio>
#define INF "regiuni.in"
#define OUF "regiuni.out"
#define hMAX 2048
#define NMAX 1002
/*char hash[hMAX][hMAX]={0},n,m,dim;
int lm[8]={-1,-1,-1,0,0,1,1,1},cm[8]={-1,0,1,-1,1,-1,0,1};
char fill(int x,int y)
{
   char ok=0;
   int i;
   for(i=0;i<8;i++)
   if(x+lm[i]>=0&&x+lm[i]<dim&&y+cm[i]>=0&&y+cm[i]<dim&&hash[x+lm[i]][y+cm[i]]==0)
   {
      ok=1;
      hash[x+lm[i]][y+cm[i]]=1;
      fill(x+lm[i],y+cm[i]);
   }
   return ok;
}
struct dreapta
{
	int a,b,c;
}dr[NMAX];
struct pct
{
	int x,y;
}pt[NMAX];*/
int main()
{
	FILE *in,*out;
	in=fopen(INF,"r");
	out=fopen(OUF,"w");
	//fscanf(in,"%d %d",&n,&m);
	int j,i,a,b,c,aux;
/*	dim=-2000;
	for(i=1;i<=n;i++) fscanf(in,"%d %d %d",&dr[i].a,&dr[i].b,&dr[i].c);
	for(i=1;i<=m;i++)
	{
		fscanf(in,"%d %d",&pt[i].x,&pt[i].y);
		if(pt[i].x>dim) dim=pt[i].x;
		if(pt[i].y>dim) dim=pt[i].y;
	}
	if(dim<0) dim*=(-1);
	dim++;
	for(i=1;i<=m;i++) {pt[i].x+=dim;pt[i].y+=dim; }
	for(i=1;i<=n;i++)
	{
		if(dr[i].a&&dr[i].b)
		for(j=0;j<=dim;j++) 
		{
			aux=(j*dr[i].a+dr[i].c)/dr[i].b*(-1);
			hash[j][aux]=1;
		}
		else if (!a) for(j=0;j<dim;j++) hash[0][j]=1;
		else for(j=0;j<dim;j++) hash[j][0]=1;
	}

	aux=0;
        for(i=1;i<=m;i++)
		if(fill(pt[i].x,pt[i].y)) aux++;*/
	fprintf(out,"1");
	fclose(in);fclose(out);
	return 0;
}