Submission #432228

#TimeUsernameProblemLanguageResultExecution timeMemory
432228jeqchoTeams (IOI15_teams)C++17
0 / 100
41 ms9108 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii> vpi; #define FOR(i,a,b) for(int i=a;i<b;++i) #define F0R(i,b) FOR(i,0,b) #define ROF(i,a,b) for(int i=b-1;i>=a;--i) #define R0F(i,b) ROF(i,0,b) #define trav(a,x) for(auto&a:x) #define all(x) begin(x),end(x) #define fi first #define se second #define pb push_back #define sz(x) int(x.size()) int const N=1e2+3; int A[N],B[N]; int n; pii stu[N]; void init(int n1, int A1[], int B1[]) { n=n1; F0R(i,n) { A[i]=A1[i]; B[i]=B1[i]; stu[i]={A[i],B[i]}; } sort(stu,stu+n); } int can(int m, int K[]) { sort(K,K+m); int cur=0; int cnt=0; F0R(i,n) { if(K[cur]>=stu[i].fi&&K[cur]<=stu[i].se) { ++cnt; } if(cnt==K[cur]) { cnt=0; ++cur; if(cur==m)break; } } return cur==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...