# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
419195 | LouayFarah | Teams (IOI15_teams) | C++14 | 0 ms | 0 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"
#include "boxes.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
int n;
vector<pair<int, int>> students;
vector<int> cnt;
void init(int N, int a[], int b[])
{
n = N;
for(int i = 0; i<n; i++)
{
students.pb(mp(a[i], b[i]));
}
sort(students.begin(), students.end());
}
int can(int m, int k[])
{
cnt.assign(m, 0);
for(int i = 0; i<m; i++)
cnt[i] = k[i];
int i = 0, j = 0;
while(i<n&&j<m)
{
if(k[j]>=students[i].fi&&k[j]<=students[i].se)
{
cnt[j]--;
}
if(cnt[j]==0)
j++;
i++;
}
if(j==m)
return 1;
return 0;
}