Submission #1016518

#TimeUsernameProblemLanguageResultExecution timeMemory
1016518MuhammetTeams (IOI15_teams)C++17
0 / 100
4083 ms40532 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; #define ff first #define ss second int n, an; vector <int> st, lz, st1, lz1; vector <pair<int,int>> a; void init(int N, int A[], int B[]) { n = N; a.resize(n); st.resize(n*8); lz.resize(n*8); for(int i = 0; i < n; i++){ a[i] = {A[i],B[i]}; swap(a[i].ff,a[i].ss); } sort(a.begin(),a.end()); for(int i = 0; i < n; i++){ swap(a[i].ff, a[i].ss); } return; } int can(int m, int k[]) { sort(k,k+m); int ind = 0, cnt = 0; for(int i = 0; i < n; i++){ if(ind == m) break;; if(a[i].ff <= k[ind] and a[i].ss >= k[ind]){ cnt++; } if(cnt == k[ind]){ cnt = 0; ind++; } } if(ind == m) return 1; else return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...