# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
262114 | Nightlight | Crocodile's Underground City (IOI11_crocodile) | C++14 | 792 ms | 81892 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 "crocodile.h"
#include <bits/stdc++.h>
#define pii pair<long long, int>
using namespace std;
int N, M;
long long ans;
vector<pii> adj[100005];
long long dist[100005], dist2[100005];
bool can[100005];
priority_queue<pii, vector<pii>, greater<pii>> pq;
void BFS() {
for(int i = 0; i < N; i++) {
if(can[i]) pq.emplace(0, i), can[i] = 0;
else dist[i] = 1000000000000, dist2[i] = 1000000000000;
}
int u, v;
long long len, w;
while(!pq.empty()) {
u = pq.top().second;
len = pq.top().first;
pq.pop();
if(can[u]) continue;
can[u] = 1;
for(pii now : adj[u]) {
v = now.second;
w = now.first;
if(dist2[u] + w < dist[v]) {
dist2[v] = dist[v];
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... |