# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
406076 | cgiosy | Aliens (IOI16_aliens) | C++17 | 95 ms | 5892 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;
using ll=long long;
struct lr {
int l, r;
bool operator<(lr b) const { return l<b.l; }
};
struct point {
ll a, b;
ll operator()(ll x) const { return a*x+b; }
};
ll ccw(point& o, point& p, point& q) {
return (o.a-p.a)*(o.b-q.b)-(o.b-p.b)*(o.a-q.a);
}
ll pw(ll x) { return x*x; }
ll take_photos(int N, int M, int K, vector<int> L, vector<int> R) {
lr A[N+1];
for(int i=0; i<N; i++) {
int x=L[i], y=R[i];
A[i]={min(x, y), max(x, y)+1};
}
sort(A, A+N);
int N2=0;
for(int i=1; i<N; i++) if(A[N2].r<A[i].r)
A[N2+=A[N2].l<A[i].l]=A[i];
K=min(K, N=N2+1);
point H[N+1];
Compilation message (stderr)
# | 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... |