Pagini recente » Cod sursa (job #2820864) | Cod sursa (job #1136924) | Cod sursa (job #714716) | Cod sursa (job #2824451) | Cod sursa (job #2617580)
#include <bits/stdc++.h>
#define maxn 200005
std::ifstream fin ("cadrane_brute.in");
std::ofstream fout ("cadrane_brute.out");
struct point{
int x, y;
}v[maxn];
int main()
{
int n, i, j, k, x, y;
fin >> n;
for (i=0; i<n; i++)
fin >> v[i].x >> v[i].y;
int score, min=0, s;
for (i=0; i<n; i++){
score = 1e9;
for (j=0; j<n; j++){
y = v[i].y;
x = v[j].x;
s = 0;
for (k=0; k<n; k++){
if (v[k].x <= x and v[k].y <= y)
s ++;
if (v[k].x >= x and v[k].y >= y)
s ++;
if (v[k].x == x and v[k].y == y)
s --;
}
score = std::min (s, score);
}
min = std::max (min, score);
}
fout << min << '\n';
return 0;
}