Submission #419199

#TimeUsernameProblemLanguageResultExecution timeMemory
419199LouayFarahTeams (IOI15_teams)C++14
0 / 100
4086 ms8900 KiB
#include "bits/stdc++.h" #include "teams.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[]) { sort(k, k + m); 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...