Submission #298695

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2986952020-09-13 19:59:48eohomegrownappsSky Walking (IOI19_walk)C++14
Compilation error
0 ms0 KiB
#include "walk.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>> adjlist[10000000]; // weight, node
ll INF = 1e18;
ll dijkstra(int n, int a, int b){
ll distance[10000000]={1e18};
distance[a]=0;
priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> pq;
pq.push({0,a});
while (pq.size()>0){
auto f = pq.top();
pq.pop();
if (f.first>distance[f.second]){continue;}
for (auto p : adjlist[f.second]){
if (distance[f.second]+p.first<distance[p.second]){
distance[p.second]=distance[f.second]+p.first;
pq.push({distance[p.second],p.second});
}
}
}
return (distance[b]==INF)?-1:distance[b];
}
long long min_distance(std::vector<int> x, std::vector<int> h, std::vector<int> l, std::vector<int> r, std::vector<int> y, int s, int g) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

walk.cpp: In function 'll dijkstra(int, int, int)':
walk.cpp:12:32: error: narrowing conversion of '1.0e+18' from 'double' to 'll' {aka 'long long int'} [-Wnarrowing]
   12 |     ll distance[10000000]={1e18};
      |                                ^
walk.cpp: In function 'long long int min_distance(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, int, int)':
walk.cpp:45:9: warning: unused variable 'numnodes' [-Wunused-variable]
   45 |     int numnodes = 0;
      |         ^~~~~~~~