Cod sursa(job #42313)

Utilizator the1dragonIonita Alexandru the1dragon Data 29 martie 2007 01:24:44
Problema Regiuni Scor 0
Compilator c Status done
Runda Arhiva de probleme Marime 0.59 kb
#include<stdio.h>

int main()
{
    char mat[1000][125];
    short int dr[1000][3], n, m, i, j, x, y, count=0;
    for (i=0; i<1000; i++)
	    for (j=0; j<125; j++)
	        mat[i][j]=0;
	        
	freopen("regiuni.in", "r", stdin);
	freopen("regiuni.out", "w", stdout);
	
	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);
	}
	printf("%hd", count);
	return 0;
}