#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
const ll INF = 1e18;
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) {
vector<vector<pii>> adj(N);
for (int i = 0; i < M; i++) {
adj[R[i][0]].push_back({R[i][1], L[i]});
adj[R[i][1]].push_back({R[i][0], L[i]});
}
priority_queue<pair<ll, int>, vector<pair<ll, int>>, greater<>> q;
vector<int> cnt(N, 0);
vector<ll> di(N, INF);
for (int i = 0; i < K; i++) {
cnt[P[i]] = 2, di[P[i]] = 0;
q.push({0, P[i]});
}
while (!q.empty()) {
auto [dist, u] = q.top();
q.pop();
cnt[u]++;
if (cnt[u] == 2) di[u] = dist;
if (cnt[u] != 2 || di[u] != dist)) continue;
for (auto& [v, w] : adj[u]) {
if (cnt[v] < 2 && di[v] > di[u] + w) {
q.push({di[u] + w, v});
}
}
}
return di[0];
}
Compilation message
crocodile.cpp: In function 'int travel_plan(int, int, int (*)[2], int*, int, int*)':
crocodile.cpp:28:42: error: expected primary-expression before ')' token
28 | if (cnt[u] != 2 || di[u] != dist)) continue;
| ^