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;
const int MAXN=5e5+6;
int n;
int a[MAXN];
int b[MAXN];
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];
}
}
int can(int M, int K[]) {
sort(K,K+M);
int sum=0;
for(int l=0;l<M;l++)
{
sum=0;
for(int r=l;r<M;r++)
{
sum+=K[r];
int cnt_av=n;
for(int i=0;i<n;i++)
{
if(a[i]>K[r])cnt_av--;
if(b[i]<K[l])cnt_av--;
}
if(cnt_av<sum)return 0;
}
}
return 1;
}
# | 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... |