Submission #745637

#TimeUsernameProblemLanguageResultExecution timeMemory
745637ogibogi2004Teams (IOI15_teams)C++14
0 / 100
4046 ms16200 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...