# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494265 | aryan12 | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 1089 ms | 4848 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;
#define int long long
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
const int INF = 1e15;
void Solve() {
int n, m;
cin >> n >> m;
vector<pair<int, int> > doge(m + 1);
vector<int> positions[n + 1];
for(int i = 1; i <= m; i++) {
cin >> doge[i].first >> doge[i].second; //position, jump;
doge[i].first++;
positions[doge[i].first].push_back(i);
}
if(doge[1].first == doge[2].first) {
cout << "0\n";
return;
}
vector<bool> vis(m + 1);
vector<int> dist(m + 1);
for(int i = 1; i <= m; i++) {
vis[i] = false;
dist[i] = INF;
}
priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq;
for(int i = 0; i < positions[doge[1].first].size(); i++) {
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... |