Submission #852022

#TimeUsernameProblemLanguageResultExecution timeMemory
85202212345678Teams (IOI15_teams)C++17
0 / 100
92 ms16580 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; const int nx=1e2+5; int n; bool used[nx]; vector<pair<int, int>> v; bool comp(pair<int, int> a, pair<int, int> b) { if (a.second==b.second) return a.first>b.first; return a.second<b.second; } void init(int N, int A[], int B[]) { n=N; for (int i=0; i<N; i++) v.push_back({A[i], B[i]}); sort(v.begin(), v.end(), comp); } int can(int M, int K[]) { sort(K, K+M); bool f=0; for (int i=0; i<n; i++) used[i]=0; for (int i=0; i<M; i++) { int cnt=K[i]; for (int j=0; j<n; j++) if (cnt>0&&!used[j]&&v[j].second>=K[i]&&K[i]>=v[j].first) used[i]=1; if (cnt>0) f=1; } return f?0: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...