Submission #411552

#TimeUsernameProblemLanguageResultExecution timeMemory
411552faresbasbsTeams (IOI15_teams)C++14
0 / 100
4048 ms16336 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; vector<pair<int,int>> all; int n; void init(int N , int A[] , int B[]){ n = N; for(int i = 0 ; i < n ; i += 1){ all.push_back({A[i],B[i]}); } sort(all.rbegin(),all.rend()); } int can(int m , int k[]){ vector<int> f; for(int i = 0 ; i < m ; i += 1){ f.push_back(k[i]); } sort(f.rbegin(),f.rend()); vector<int> f2 = f; int tag = 0; for(auto i : all){ if(i.first <= f2[tag] && i.second >= f2[tag]){ f[tag] -= 1; } if(f[tag] == 0){ tag += 1; } if(tag == (int)f.size()){ 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...