Submission #751905

#TimeUsernameProblemLanguageResultExecution timeMemory
751905SebTeams (IOI15_teams)C++17
21 / 100
34 ms15128 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define f first #define s second typedef long long ll; const ll MAXN = 2e2+5; ll n,cnt[MAXN]; pair <ll,ll> p[MAXN]; bool flag[MAXN]; void init(int N, int A[], int B[]) { n = N; for (int i=0;i<N;i++) p[i] = {A[i],B[i]}; sort(p,p+N,[&] (pair<ll,ll> a, pair<ll,ll> b) {return a.s < b.s;}); return; } int can(int M, int K[]) { for (int i=0;i<MAXN;i++) { flag[i] = false; cnt[i] = 0; } sort(K,K+M); for (int j=0;j<M;j++) for (int i=0;i<n;i++) if (flag[i]==false && p[i].f<=K[j] && p[i].s>=K[j]) { flag[i] = true; cnt[j]++; if (cnt[j]==K[j]) break; } for (int i=0;i<M;i++) if (cnt[i]!=K[i]) 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...