# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1092897 | Pannda | Meetings (JOI19_meetings) | C++17 | 1055 ms | 1672 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "meetings.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int n) {
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
auto work = [&](auto self, vector<int> dom) -> void {
shuffle(dom.begin(), dom.end(), rng);
int r = dom.back();
dom.pop_back();
vector<vector<int>> branches;
vector<int> heads;
for (int u : dom) {
bool found = false;
for (int i = 0; !found && i < heads.size(); i++) {
int get = Query(r, u, heads[i]);
if (get == r) {
// nothing
} else if (get == u) {
heads[i] = u;
branches[i].push_back(u);
found = true;
} else {
branches[i].push_back(u);
found = true;
}
}
if (!found) {
heads.push_back(u);
branches.push_back({u});
}
}
for (int u : heads) {
if (r < u) Bridge(r, u);
else Bridge(u, r);
}
for (vector<int> branch : branches) {
self(self, branch);
}
};
work(work, [&]() -> vector<int> {
vector<int> dom(n);
iota(dom.begin(), dom.end(), 0);
return dom;
}());
}
컴파일 시 표준 에러 (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... |