# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
329724 | figter001 | Teams (IOI15_teams) | C++17 | 4062 ms | 16468 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 all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<pair<int,int>> s;
int n;
void init(int N, int A[], int B[]) {
n = N;
for(int i=0;i<n;i++){
s.push_back({A[i], B[i]});
}
sort(all(s) , [](pair<int,int> a,pair<int,int> b){
if(a.second == b.second)
return a.first < b.first;
return a.second < b.second;
});
}
int can(int M, int K[]) {
sort(K,K+M);
int id = 0,cnt=0;
for(int i=0;i<s.size();i++){
if(id == M)break;
cnt += (s[i].first <= K[id] && s[i].second >= K[id]);
if(cnt == K[id]){
cnt = 0;
id++;
}
}
return id == M;
}
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... |