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 "teams.h"
using namespace std;
#define ff first
#define ss second
int n, an;
vector <int> st, lz, st1, lz1;
vector <pair<int,int>> a;
void init(int N, int A[], int B[]) {
n = N;
a.resize(n);
st.resize(n*8);
lz.resize(n*8);
for(int i = 0; i < n; i++){
a[i] = {A[i],B[i]};
swap(a[i].ff,a[i].ss);
}
sort(a.begin(),a.end());
for(int i = 0; i < n; i++){
swap(a[i].ff, a[i].ss);
}
return;
}
int can(int m, int k[]) {
sort(k,k+m);
int ind = 0, cnt = 0;
for(int i = 0; i < n; i++){
if(ind == m) break;;
if(a[i].ff <= k[ind] and a[i].ss >= k[ind]){
cnt++;
}
if(cnt == k[ind]){
cnt = 0;
ind++;
}
}
if(ind == m) return 1;
else return 0;
}
# | 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... |