# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569198 | Alan | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 264 ms | 112292 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.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[30001];
struct node {
int u, di, vel;
};
int main() {
ios::ios_base::sync_with_stdio(false);
cin.tie(0);
bitset<30001> vis[30001];
int n, m, b, p, d0 = 0, d1 = 0;
scanf("%d %d", &n, &m);
for (int i = 0; i < m; i++) {
scanf("%d %d", &b, &p);
if (i == 0) d0 = b;
if (i == 1) d1 = b;
if (0 <= b+p && b+p < n) adj[b].push_back(p);
if (0 <= b-p && b-p < n) adj[b].push_back(-p);
}
queue<node> bfs;
bfs.push({d0, 0, 0});
while (!bfs.empty()) {
auto [u, di, vel] = bfs.front();
if (u == d1) {
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... |