# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
932665 | Programmer123 | 분수 공원 (IOI21_parks) | C++17 | 2828 ms | 85324 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "parks.h"
std::unordered_map<int, int> map[200001];
int N;
std::vector<std::pair<int, int>> vld[200000];
std::pair<int, int> assigned[200000];
std::set<std::pair<int, int>> taken;
time_t stop;
std::default_random_engine Rand(std::random_device{}());
bool shuffle = false;
bool backtrack(int n) {
if (n == N - 1) return true;
if (clock() > stop) return false;
if (shuffle && vld[n].size() == 2 && Rand() % 2) {
std::swap(vld[n][0], vld[n][1]);
}
for (auto a: vld[n]) {
if (taken.count(a)) continue;
taken.insert(a);
if (backtrack(n + 1)) {
assigned[n] = a;
return true;
}
taken.erase(a);
}
return false;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |