| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 563376 | hoanghq2004 | Building Skyscrapers (CEOI19_skyscrapers) | C++14 | 391 ms | 23868 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, T;
map <pair <int, int>, int> mp, vis;
int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int main() {
// freopen("test.inp", "r", stdin);
ios :: sync_with_stdio(0); cin.tie(0);
cin >> n >> T;
vector <pair <int, int> > P;
int X = 0, Y = 0;
for (int i = 1; i <= n; ++i) {
int x, y;
cin >> x >> y;
mp[{x, y}] = i;
X = x, Y = y;
}
priority_queue <pair <int, int> > q;
q.push({X, Y});
vis[{X, Y}] = 1;
vector <int> ans;
while (q.size()) {
int x = q.top().first;
int y = q.top().second;
ans.push_back(mp[{x, y}]);
q.pop();
for (int i = 0; i < 8; ++i) {
int u = x + dx[i];
int v = y + dy[i];
if (mp.find({u, v}) == mp.end() || vis[{u, v}]) continue;
vis[{u, v}] = 1;
q.push({u, v});
}
}
if (ans.size() != n) {
cout << "NO\n";
exit(0);
}
cout << "YES\n";
for (int i = 0; i < ans.size(); ++i) cout << ans[i] << '\n';
}
컴파일 시 표준 에러 (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... | ||||
