# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82364 | EntityIT | 007 (CEOI14_007) | C++14 | 370 ms | 16636 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<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
typedef pair<int, int> ii;
const int N = 2e5 + 5, inf = 1e9 + 123;
int n, m, src[2], a[2], d[2][N], l = -1, r = 6e5 + 5;
vector<int> gr[N];
void dijkstra (bool _) {
for (int i = 1; i <= n; ++i) d[_][i] = inf;
d[_][ src[_] ] = 0;
priority_queue<ii, vector<ii>, greater<ii> > pq; pq.push(ii(d[_][ src[_] ], src[_]) );
while (!pq.empty() ) {
ii tmp = pq.top(); pq.pop();
int u = tmp.se;
if (tmp.fi > d[_][u]) continue ;
for (int v : gr[u]) {
if (d[_][v] > d[_][u] + 1) {
d[_][v] = d[_][u] + 1;
pq.push(ii(d[_][v], v) );
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |