# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
780496 | vjudge1 | Teams (IOI15_teams) | C++17 | 4067 ms | 10820 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>
using namespace std;
#define pb push_back
#define st first
#define nd second
#define sp " "
#define pii pair<int, int>
int a[500005], b[500005], n;
void init(int N, int A[], int B[]) {
n = N;
vector<int> v(N);
iota(v.begin(), v.end(), 0);
sort(v.begin(), v.end(), [&](int a, int b){
if (B[a] == B[b]) return A[a] < A[b];
return B[a] < B[b];
});
for (int i = 0; i < N; i++)
{
a[i] = A[v[i]], b[i] = B[v[i]];
//cout<<a[i]<<sp<<b[i]<<endl;
}
}
int can(int M, int K[]) {
sort(K, K + M);
vector<int> vis(n, 0);
for (int i = 0; i < M; i++){
int curr = K[i];
for (int j = 0; j < n && curr > 0; j++){
if (vis[j]) continue;
if (a[j] <= K[i] && b[j] >= K[i]){
vis[j] = 1, curr--;
}
}
if (curr > 0) return 0;
}
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... |