이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vii> vvii;
typedef vector<vll> vvll;
typedef vector<vpii> vvpii;
typedef vector<vpll> vvpll;
#define ffor(i, a, b) for (ll i = (a); i < (ll)(b); i++)
#define fford(i, a, b) for (ll i = (a); i > (ll)(b); i--)
#define rep(i, n) ffor(i, 0, n)
#define forin(x, a) for (auto &x: a)
#define all(a) a.begin(), a.end()
vpii students;
void init(int N, int A[], int B[]) {
rep(i, N) {
students.emplace_back(B[i], A[i]);
}
sort(all(students));
rep(i, N) {
swap(students[i].first, students[i].second);
}
}
int can(int M, int K[]) {
map<int, int> k;
rep(i, M) {
k[K[i]] += K[i];
}
forin(s, students) {
auto lowest = k.lower_bound(s.first);
if (lowest != k.end() && lowest->first <= s.second) {
int x = lowest->first;
k[x]--;
if (!k[x]) {
k.erase(x);
}
}
}
return k.empty();
}
# | 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... |