# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1148593 | blackslex | Jakarta Skyscrapers (APIO15_skyscraper) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int n, m;
int main() {
scanf("%d %d", &n, &m);
vector<vector<int>> v(n + 5, vector<int>()), v2(n + 5, vector<int>());
vector<pii> c(m);
for (auto &[x, y]: c) scanf("%d %d", &x, &y);
for (int i = 0; i < m; i++) {
auto [x, y] = c[i];
if (i != 1) {
for (int j = x + y; j < n; j += y) {
v[j - y].emplace_back(j);
v[j].emplace_back(j - y);
}
for (int j = x - y; j >= 0; j -= y) {
v[j + y].emplace_back(j);
v[j].emplace_back(j + y);
}
}
if (i != 0) {
for (int j = x + y; j < n; j += y) {
v2[j - y].emplace_back(j);
v2[j].emplace_back(j - y);
}
for (int j = x - y; j >= 0; j -= y) {
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... |