# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140374 | SirCeness | Teams (IOI15_teams) | C++14 | 4089 ms | 46324 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 "teams.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define inside sl<=l&&r<=sr
#define outside r<sl||sr<l
#define orta ((l+r)>>1)
#define INF 1000000009
#define mod 1000000007
#define ppair(x); cerr << "(" << x.first << ", " << x.second << ")\n";
#define bas(x) #x << ": " << x << " "
#define prarr(x, n); cerr << #x << ": "; for(int qsd = 0; qsd < n; qsd++) cerr << x[qsd] << " "; cerr << "\n";
#define prarrv(x); cerr << #x << ": "; for(int qsd = 0; qsd < (int)x.size(); qsd++) cerr << x[qsd] << " "; cerr << "\n";
using namespace std;
typedef long long ll;
int n;
vector<list<int> > arr;
void init(int N, int A[], int B[]){
n = N;
arr.resize(n+1);
for (int i = 0; i < n; i++){
arr[A[i]].pb(B[i]);
}
}
void prset(multiset<int> cur){
for (int a: cur) cout << a << " "; cout << endl;
}
int can(int M, int K[]){
multiset<int> cur;
int ki = 0;
sort(K, K+M);
for (int i = 1; i <= n; i++){
for (int a: arr[i]){
cur.insert(a);
}
//prset(cur);
while (ki != M && K[ki] == i){
for (int q = 0; q < i; q++){
if (cur.size() == 0) return 0;
cur.erase(cur.begin());
}
ki++;
}
while (cur.size() > 0 && *cur.begin() <= i) cur.erase(cur.begin());
}
return 1;
}
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... |