# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
786726 | vnm06 | Teams (IOI15_teams) | C++14 | 4077 ms | 10060 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 uchenik
{
int le, ri;
uchenik() {}
uchenik(int a, int b)
{
le=a;
ri=b;
}
};
bool operator<(uchenik a, uchenik b)
{
if(a.le==b.le) return a.ri<b.ri;
return a.le<b.le;
}
int n;
uchenik t[100005];
void init(int N, int A[], int B[])
{
n=N;
for(int i=0; i<n; i++) t[i].le=A[i], t[i].ri=B[i];
sort(t, t+n);
}
multiset<int> st;
int can(int M, int K[])
{
st.clear();
int id=0;
sort(K, K+M);
for(int i=0; i<M; i++)
{
while(id<n && t[id].le<=K[i])
{
st.insert(t[id].ri);
id++;
}
while(!st.empty() && (*st.begin())<K[i]) st.erase(st.begin());
if(st.size()<K[i]) return 0;
for(int j=0; j<K[i]; j++) st.erase(st.begin());
}
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... |