Submission #349928

#TimeUsernameProblemLanguageResultExecution timeMemory
349928idk321Crocodile's Underground City (IOI11_crocodile)C++11
100 / 100
888 ms73980 KiB
#include "crocodile.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 100001; const ll M = 2000000000000000000LL; vector<array<int, 2>> adj[N]; vector<array<ll, 2>> path(N, {M, M}); bool vis[N]; int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]) { 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<array<ll, 2>, vector<array<ll, 2>>, greater<array<ll, 2>>> pq; for (int i = 0; i < k; i++) { int node = p[i]; path[node] = {0, 0}; pq.push({0, node}); } while (!pq.empty()) { int node = pq.top()[1]; ll dist = pq.top()[0]; pq.pop(); if (vis[node]) continue; vis[node] = true; for (auto next : adj[node]) { if (vis[next[0]]) continue; array<ll, 3> ar {path[next[0]][0], path[next[0]][1], dist + next[1]}; sort(ar.begin(), ar.end()); path[next[0]][0] = ar[0]; path[next[0]][1] = ar[1]; //cout << ar[0] << " " << ar[1] << " " << ar[2] << " " << next[0] << endl; if (path[next[0]][1] != M) pq.push({path[next[0]][1], next[0]}); } } return path[0][1]; } ///home/domen/Downloads/crocodile/crocodile.cpp|19|error: request for member ‘push_back’ in ‘(*(r + ((sizetype)(((long unsigned int)i) * 8))))[1]’, which is of non-class type ‘int’|
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...