Submission #663138

#TimeUsernameProblemLanguageResultExecution timeMemory
663138karriganTeams (IOI15_teams)C++14
0 / 100
3654 ms14640 KiB
#include<bits/stdc++.h> #include <teams.h> using namespace std; int a[100001]; int b[100001]; vector<int>use[100001]; int vis[100001]; bool cmp(int i,int j){ return b[i]<b[j]; } int n; void init(int N,int A[],int B[]){ n=N; for (int i=1;i<=n;i++){ a[i]=A[i-1]; b[i]=B[i-1]; } for (int i=1;i<=n;i++){ for (int j=1;j<=n;i++){ if (a[j]<=i&&b[j]>=i){ use[i].push_back(j); } } sort(use[i].begin(),use[i].end(),cmp); } } int can(int M,int K[]){ for (int i=1;i<=n;i++)vis[i]=0; sort(K,K+M); for (int i=0;i<M;i++){ int cnt=0; for (auto v:use[K[i]]){ if (cnt==K[i])break; vis[v]=1; cnt++; } if (cnt<K[i])return 0; } return 1; } /*int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); srand(time(NULL)); //freopen("test.INP","r",stdin); //freopen(".OUT","w",stdout); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...