# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
146014 | mhy908 | Jakarta Skyscrapers (APIO15_skyscraper) | C++14 | 115 ms | 4044 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>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define inf 987654321
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
int n, m;
int b[30010], p[30010];
int dijk[30010];
priority_queue<pii> pq;
vector<int> jump[30010];
void dijkstra(int st)
{
pq.push({0, st});
dijk[st]=0;
while(!pq.empty()){
pii y=pq.top();
int here=y.S, th=-y.F;
pq.pop();
if(dijk[here]<th)continue;
for(int i=0; i<jump[here].size(); i++){
for(int j=here-jump[here][i]; j>=0; j-=jump[here][i]){
if(dijk[j]>dijk[here]+(here-j)/jump[here][i]){
dijk[j]=dijk[here]+(here-j)/jump[here][i];
pq.push({-dijk[j], j});
}
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... |