# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121056 | SalihSahin | Teams (IOI15_teams) | C++14 | 4059 ms | 15172 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
#include "teams.h"
vector<pair<int, int> > st;
bool comp(pair<int, int> p1, pair<int, int> p2){
if(p1.second == p2.second) return (p1.first < p2.first);
else return (p1.second < p2.second);
}
void init(int N, int A[], int B[]){
for(int i = 0; i < N; i++){
st.pb({A[i], B[i]});
}
sort(st.begin(), st.end(), comp);
}
int can(int M, int K[]) {
sort(K, K + M);
vector<int> cnt(M);
for(int i = 0; i < st.size(); i++){
for(int j = 0; j < M; j++){
if(cnt[j] < K[j] && st[i].first <= K[j] && st[i].second >= K[j]){
cnt[j]++;
//cout<<j<<" -> "<<K[j]<<" ye "<<st[i].first<<" "<<st[i].second<<endl;
break;
}
}
}
bool ok = 1;
for(int i = 0; i < M; i++){
if(cnt[i] != K[i]) ok = 0;
}
return ok;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |