Submission #1021832

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10218322024-07-13 05:55:09m5588ohammedValley (BOI19_valley)C++14
0 / 100
84 ms10992 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

valley.cpp: In function 'void dij()':
valley.cpp:14:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   14 |         auto [mydis,i]=qu.top();
      |              ^
valley.cpp:18:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   18 |         for(auto [j,w]:v[i]){
      |                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...