제출 #803019

#제출 시각아이디문제언어결과실행 시간메모리
803019Liudas팀들 (IOI15_teams)C++17
0 / 100
4067 ms11332 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; vector<pair<int, int>> arr; vector<bool> taken; int N; void init(int K, int A[], int B[]){ N = K; for(int i = 0; i < N; i ++){ arr.push_back({A[i], B[i]}); } taken.resize(N); sort(arr.begin(), arr.end()); sort(arr.begin(), arr.end(), [](pair<int,int> a, pair<int,int>b){return a.second -a.first < b.second -b.first;}); } int can(int M, int K[]){ fill(taken.begin(), taken.end(), false); for(int i = 0; i < M; i ++){ int need = K[i]; int id = 0; int got = 0; while(id < N && got < need){ if(!taken[id] && arr[id].first <= need && arr[id].second >= need){ got++; taken[id] = true; } id++; } if(got < need){ 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...