# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1021832 | m5588ohammed | Valley (BOI19_valley) | C++14 | 84 ms | 10992 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
#define endl "\n"
int n,S,E,q,U,V,x,l;
vector <array<int,2>> v[100001],edges;
priority_queue <array<int,2>> qu;
int dis[100001],shops[100001];
void dij(){
for(int i=1;i<=n;i++) dis[i]=1e13;
dis[x]=0;
qu.push({0,x});
while(!qu.empty()){
auto [mydis,i]=qu.top();
mydis*=-1;
qu.pop();
if(mydis>dis[i]) continue;
for(auto [j,w]:v[i]){
if((i==U&&j==V)||(i==V&&j==U)) continue;
if(dis[j]>mydis+w){
dis[j]=mydis+w;
qu.push({dis[j]*-1,j});
}
}
}
return;
}
void calc1(){
while(q--){
cin>>l>>x;
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... |