제출 #128190

#제출 시각아이디문제언어결과실행 시간메모리
128190MoNsTeR_CuBe팀들 (IOI15_teams)C++17
0 / 100
4091 ms13304 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; vector< int > usefulPerson; vector< int > A; vector< int > B; int N; void init(int n, int a[], int b[]) { N = n; A.resize(n); B.resize(n); vector< pair<int, int> > temp(n); for(int i = 0; i < n; i++){ A[i] = a[i]; B[i] = b[i]; temp[i] = make_pair(b[i], a[i]); } sort(temp.begin(), temp.end()); for(int i = 0; i < n; i++){ b[i] = temp[i].first; a[i] = temp[i].second; } } int can(int M, int K[]) { sort(K, K+M); vector< int > visited(N, false); for(int i = 0; i < M; i++){ int rem = K[i]; for(int j = 0; j < N; j++){ if(A[j] <= K[i] && B[j] >= K[i] && !visited[j] && rem){ visited[j] = true; rem--; } if(!rem) break; } if(rem) return 0; } 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...