Cod sursa(job #42278)

Utilizator the1dragonIonita Alexandru the1dragon Data 29 martie 2007 00:42:31
Problema Regiuni Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include<stdio.h>
//#include<stdlib.h>

unsigned char mat[1024][128];

int main()
{
	freopen("regiuni.in", "r", stdin);
	freopen("regiuni.out", "w", stdout);
	
	short int dr[1024][3], n, m, i, j, x, y, count=0;
	scanf("%hd%hd", &n, &m);
	
	for (i=0; i<n; i++)
		scanf("%hd%hd%hd", &dr[0][i], &dr[1][i], &dr[2][i]);
	
	for (i=0; i<m; i++)
	{
		scanf("%hd%hd", &x, &y);
		for (j=0; j<n; j++)
			if (dr[0][j]*x+dr[1][j]*y+dr[2][j] > 0) mat[i][j/8]= mat[i][j/8] |  ((1<<7)>>j%8);
	}
	
	/*
	for (i=0; i<m; i++)
	{
		for (j=0; j<=n/8; j++)
			printf("%d ", mat[i][j]);
		printf("\n");
	}
	*/
	
	printf("%hd", count);
	return 0;
}