# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034132 | fv3 | Teams (IOI15_teams) | C++17 | 4101 ms | 16520 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 "teams.h"
#include <bits/stdc++.h>
using namespace std;
struct range
{
int l, r;
bool operator<(const range other) const
{
return r < other.r || r == other.r && l < other.l;
}
};
int N;
vector<range> v;
void init(int N_, int A[], int B[])
{
N = N_;
v.resize(N);
for (int i = 0; i < N; i++)
{
v[i] = {A[i], B[i]};
}
sort(v.begin(), v.end());
}
int can(int M, int K_[])
{
map<int, int> K;
set<int> s;
for (int i = 0; i < M; i++)
{
s.insert(K_[i]);
K[K_[i]] += K_[i];
}
for (int i = 0; i < N; i++)
{
auto it = s.lower_bound(v[i].l);
if (it == s.end() || *it > v[i].r) continue;
if (!--K[*it])
{
s.erase(it);
}
}
for (auto e : K)
{
if (e.second)
return 0;
}
return 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... |