Submission #769009

#TimeUsernameProblemLanguageResultExecution timeMemory
769009boyliguanhanTeams (IOI15_teams)C++17
0 / 100
4070 ms16696 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; pair<int, int> people[100100]; int n; void init(int N, int A[], int B[]) { n = N; for(int i = 0; i < n; i++) people[i] = {B[i], A[i]}; sort(people, people+n); for(int i = 0; i < n; i++) swap(people[i].first, people[i].second); } int can(int M, int K[]) { sort(K, K+M); int cur = 0, got = 0; for(int i = 0; i < n; i++) { if(people[i].second < K[cur]||people[i].first>K[cur]) continue; got++;if(got==K[cur]){if(++cur==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...