You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
499 B
25 lines
499 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
const int N = 110;
|
|
int x[N], y[N];
|
|
int n;
|
|
int maxv, maxp;
|
|
int main() {
|
|
cin >> n;
|
|
for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
|
|
for (int i = 1; i <= n; i++){
|
|
int cnt = 0;
|
|
for (int j = 1; j <= n; j++)
|
|
if (x[i] > x[j] && y[i] > y[j]) cnt++;
|
|
if(cnt>=maxv){
|
|
maxv = cnt;
|
|
maxp = i;
|
|
}
|
|
cout << cnt;
|
|
|
|
}
|
|
cout << endl;
|
|
cout << maxp << endl;
|
|
return 0;
|
|
} |