제출 #424891

#제출 시각아이디문제언어결과실행 시간메모리
424891ollel팀들 (IOI15_teams)C++14
34 / 100
4082 ms13036 KiB
#include <bits/stdc++.h> #include <iostream> #include "teams.h" using namespace std; #define rep(i,a,b) for(int i = a; i < b; i++) #define pb push_back #define lso(x) x&(-x) typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; struct seg { int a, b; bool marked = false; }; vector<seg> s; int n; void init(int N, int a[], int b[]) { n = N; s.resize(n); rep(i,0,n) { s[i].a = a[i]; s[i].b = b[i]; } sort(s.begin(), s.end(), [](seg x, seg y) { return x.b < y.b; }); } int can(int m, int k[]) { vi p(m); rep(i,0,m) p[i] = k[i]; sort(p.begin(), p.end()); rep(i,0,n) s[i].marked = false; rep(i,0,m) { int t = p[i], left = p[i]; rep(j, 0, n) { if((!s[j].marked) && s[j].a <= t && s[j].b >= t) { left--; s[j].marked = true; if (left == 0) break; } } if (left > 0) 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...