Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- struct Pair {
- int m, h;
- } a[100500];
- bool cmp(Pair p1, Pair p2) {
- return p1.m < p2.m && p1.h < p2.h;
- }
- int main(){
- int n, w, h;
- int q[100500][2];
- cin >> n >> w >> h;
- for(int i = 1; i <= n; i++){
- cin >> a[i].m >> a[i].h;
- }
- for(int i = 1; i <= n; i++){
- q[i][0] = a[i].m;
- q[i][1] = a[i].h;
- }
- int ans = 1;
- sort(a+1, a+n+1, cmp);
- int w[100500][2];
- for(int i = 2; i <= n; i++){
- if(a[i].m > a[i-1].m && a[i].h > a[i-1].h){
- ans++;
- }
- }
- for(int i = 1; <= n; i++)
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement