Pagini recente » Cod sursa (job #1821309) | Clasament testfminostres | Cod sursa (job #216046) | Cod sursa (job #634308) | Cod sursa (job #733104)
Cod sursa(job #733104)
#include <fstream>
using namespace std;
#define Ecu(a,b,c,x,y) ( a*x+b*y+c )
#define For(a,b,c) for(a=b;a<=c;++a)
typedef short Aux;
#define Nmax 1011
typedef int Sir[Nmax];
Sir Point,a,b,c,x,y;
bool OKE[Nmax];
short Np,Nd,co;
Aux i,j;
ifstream F("regiuni.in");
ofstream G("regiuni.out");
int main()
{
F>>Nd>>Np;
For (i,1,Nd) F>>a[i]>>b[i]>>c[i];
For (i,1,Np) F>>x[i]>>y[i];
For (i,1,Nd)
For (j,1,Np)
if ( Ecu( a[i], b[i], c[i], x[j], y[j] ) > 0 )
++Point[j];
for (int i=1;i<=Np;++i)
if ( !OKE[Point[i]] )
++co,
OKE[Point[i]]=1;
G<<co<<'\n';
F.close();
G.close();
return 0;
}