# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
262127 | amiratou | Teams (IOI15_teams) | C++14 | 4069 ms | 361392 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;
#define pb push_back
#define ll long long
int n,a[100005],b[100005];
vector<int> vec[100005];
void init(int N, int A[], int B[]) {
n=N;
for (int i = 0; i < n; ++i)
{
a[i]=A[i];
b[i]=B[i];
}
for (int i = 1; i <= n; ++i)
for (int j = 0; j < n; ++j)
if(a[j]<=i && i<=b[j])vec[i].pb(j);
}
int can(int M, int K[]) {
sort(K,K+M);
set<int> myset;
ll sum=0;
for (int i = 0; i < M; ++i)
{
sum+=K[i];
for(auto it:vec[K[i]])
myset.insert(it);
if(myset.size()<sum)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... |