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;
long long take_photos(int n, int m, int k, vector<int> r, vector<int> l) {
for (int i = 0; i < n; 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--) {
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |