Submission #289015

#TimeUsernameProblemLanguageResultExecution timeMemory
289015user202729Teams (IOI15_teams)C++17
0 / 100
4048 ms12784 KiB
// moreflags=grader.cpp // // 10 #include "teams.h" #include<vector> #include<queue> #include<functional> #include<algorithm> std::vector<std::pair<int, int>> students; void init(int N, int A[], int B[]) { students.clear(); students.reserve(N); for(int i=0; i<N; ++i) students.push_back({A[i], B[i]}); std::sort(begin(students), end(students)); } int can(int M, int K[]) { std::priority_queue<int, std::vector<int>, std::greater<int>> rights; auto iterator=students.begin(); for(int index=0; index<M; ++index){ auto const k=K[index]; while(iterator!=students.end() and iterator->first<=k){ rights.push(iterator->second); ++iterator; } while(not rights.empty() and rights.top()<k) rights.pop(); for(int _=0; _<k; ++_){ if(rights.empty()) return 0; rights.pop(); } } 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...