Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <stdlib.h>
- #include <string>
- #include <string.h>
- #include <vector>
- #include <stack>
- #include <queue>
- #include <deque>
- #include <set>
- #include <map>
- #include <assert.h>
- #include <algorithm>
- #include <iomanip>
- #include <time.h>
- #include <math.h>
- #include <bitset>
- #include <fstream>
- #define int uint64_t
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(false);
- set<pair<int,int>> data;
- vector<pair<int,int>> data2;
- int n,xa,ya;
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> xa >> ya;
- data.emplace(min(xa,ya), max(xa,ya));
- data2.emplace_back(min(xa,ya), max(xa,ya));
- }
- int counter = 0;
- for (auto obj : data2) {
- bool is_found = false;
- for (auto el : data) {
- if (el.first > obj.first && el.second > obj.second) {
- is_found = true;
- break;
- }
- }
- if (!is_found)
- counter++;
- }
- cout << counter;
- }
Advertisement
Add Comment
Please, Sign In to add comment