Submission #298927

#TimeUsernameProblemLanguageResultExecution timeMemory
298927BlancaHMTeams (IOI15_teams)C++14
0 / 100
4051 ms16376 KiB
#include <iostream> #include <fstream> #include <cfloat> #include <iomanip> #include <vector> #include <algorithm> #include <queue> #include <stack> #include <cstring> #include <cmath> #include <climits> #include <set> #include <map> #include <unordered_set> #include <unordered_map> using namespace std; typedef pair<int, int> pii; typedef long long int ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef vector<vvvi> vvvvi; typedef vector<pii> vpii; typedef vector<vpii> vvpii; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<vvl> vvvl; typedef vector<vvvl> vvvvl; typedef vector<string> vs; #define fir first #define sec second #define pb push_back #define eb emplace_back #define ppb pop_back #define pf push_front #define ppf pop_front #define mp make_pair #define len(v) ((int)v.size()) #define all(v) v.begin(), v.end() int num; vpii pref; void init(int N, int* A, int* B) { num = N; pref = vpii(N); for (int i = 0; i < N; i++) { pref[i] = mp(A[i], B[i]); } sort(pref.begin(), pref.end()); } int can(int M, int* K) { sort(K, K+M); int i = 0, j = 0, inc; bool pos; while(i < num && j < M) { if (pref[i].first > K[j]) return 0; if (pref[i].second >= K[j]) { pos = true; inc = i+1; for (int n = j+1; n < j+K[j]; n++) { if (pref[n].second >= K[j]) inc = n+1; else { pos = false; break; } } i = inc; if (pos) j++; } else i++; } return j == M; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...