# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
985839 | duckindog | Building Skyscrapers (CEOI19_skyscrapers) | C++17 | 55 ms | 11772 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 <bits/stdc++.h>
using namespace std;
const int N = 150'000 + 10,
dx[8] = {-1, 0, 1, -1, 1, 1, 0, -1},
dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int n, type;
struct Point {
int r, c, idx;
bool operator > (const auto& rhs) {
return make_pair(r, c) > make_pair(rhs.r, rhs.c);
}
friend ostream& operator << (ostream& os, const auto& rhs) {
return os << rhs.r << " " << rhs.c << " " << rhs.idx;
}
} p[N];
unordered_map<int, unordered_map<int, int>> rvs;
bool mk[N];
vector<int> answer;
void dfs(int idx) {
int r = p[idx].r, c = p[idx].c;
answer.push_back(idx);
for (int i = 0; i < 8; ++i) {
int nR = r + dx[i], nC = c + dy[i],
nxt = rvs[nR][nC];
if (!nxt || mk[nxt]) continue;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |