이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma region dalykai
template <typename F>
void _debug(F f)
{
f();
}
#ifndef _AAAAAAAAA
#define debug(x)
#else
#define debug(x) _debug(x)
#endif
using p32 = pair<int, int>;
using p32u = pair<uint32_t, uint32_t>;
using p64 = pair<int64_t, int64_t>;
using p64u = pair<uint64_t, uint64_t>;
using vi16 = vector<int16_t>;
using vi16u = vector<uint16_t>;
using vi32 = vector<int>;
using vi32u = vector<uint32_t>;
using vi64 = vector<int64_t>;
using vi64u = vector<uint64_t>;
using vp32 = vector<p32>;
using vp32u = vector<p32u>;
using vp64 = vector<p64>;
using vp64u = vector<p64u>;
using vvi32 = vector<vi32>;
using vvi32u = vector<vi32u>;
using vvi64 = vector<vi64>;
using vvi64u = vector<vi64u>;
using vvp32 = vector<vp32>;
using vvp32u = vector<vp32u>;
using vvp64 = vector<vp64>;
using vvp64u = vector<vp64u>;
using f80 = long double;
#pragma endregion
vp32 child;
void init(int n, int a[], int b[])
{
child.resize(n);
for (int i = 0; i < n; i++)
{
child[i] = {a[i], b[i]};
}
}
int can(int m, int k[])
{
vi32 group(m);
for (int i = 0; i < m; i++)
{
group[i] = k[i];
}
sort(group.begin(), group.end());
auto comp = [](p32 &a, p32 &b)
{
return (a.second == b.second) ? a.first > b.first : a.second > b.second;
};
priority_queue<p32, vector<p32>, decltype(comp)> unused(comp);
for (auto &i : child)
{
unused.push(i);
}
for (auto &i : group)
{
vp32 later;
int count = 0;
while (!unused.empty() && count < i)
{
auto [low, hi] = unused.top();
unused.pop();
if (i < low || i > hi)
{
later.emplace_back(low, hi);
continue;
}
count++;
}
if (count < i)
{
return 0;
}
for (auto &l : later)
{
unused.push(l);
}
}
return 1;
}
컴파일 시 표준 에러 (stderr) 메시지
teams.cpp:8: warning: ignoring '#pragma region dalykai' [-Wunknown-pragmas]
8 | #pragma region dalykai
|
teams.cpp:43: warning: ignoring '#pragma endregion ' [-Wunknown-pragmas]
43 | #pragma endregion
|
# | 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... |