Cod sursa(job #2219560)
| Utilizator | Data | 9 iulie 2018 12:41:16 | |
|---|---|---|---|
| Problema | Ograzi | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <iostream>
using namespace std;
#include <fstream>
ifstream f("ograzi.in");
ofstream g("ograzi.out");
struct puncte
{
int wi,hi;
}v[50000];
int main()
{
long long n,m,w,h,i,j,nr=0,sw,x,y;
f>>n>>m>>w>>h;
for(i=0;i<n;i++)
{
f>>v[i].wi>>v[i].hi;
}
for(i=0;i<m;i++)
{
sw=0;
f>>x>>y;
for(j=0;j<n;j++)
if(v[j].wi<=x&&(v[j].wi+w)>=x&&v[j].hi<=y&&(v[j].hi+h)>=y&&sw==0)
{
sw=1;
nr++;
}
}
g<<nr;
}
