# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
464565 | pikel_rik | Aliens (IOI16_aliens) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, k;
cin >> n >> m >> k;
vector<int> r(n), l(n);
for (int i = 0; i < n; i++) {
cin >> r[i] >> l[i];
if (r[i] < l[i]) {
swap(r[i], l[i]);
}
}
vector<int> ind(n);
iota(ind.begin(), ind.end(), 0);
sort(ind.begin(), ind.end(), [&](int i, int j) {
return l[i] < l[j] || (l[i] == l[j] && r[i] > r[j]);
});
int mx = INT_MIN;
ind.erase(remove_if(ind.begin(), ind.end(), [&](int i) {
if (r[i] <= mx) {
return true;
} else {
mx = r[i];
return false;
}
}), ind.end());
int sz = (int) ind.size();
sort(ind.begin(), ind.end(), [&](int i, int j) {
return r[i] < r[j];
});
for (int i = sz - 1; i >= 0; i--) {
}
cout << 0 << '\n';
return 0;
}