# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82363 | FutymyClone | 007 (CEOI14_007) | C++14 | 413 ms | 87572 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;
const int N = 2e5 + 5;
int n, m, s, d, a, b, dist[2][N];
vector <int> g[N];
queue <int> q;
void bfs (int type){
if (!type) memset(dist, 0x3f, sizeof(dist));
dist[type][(type == 0) ? d : s] = 0;
q.push((type == 0) ? d : s);
while (!q.empty()) {
int u = q.front(); q.pop();
for (auto v: g[u]) {
if (type == 0 && v == s) continue;
if (dist[type][v] > dist[type][u] + 1) {
dist[type][v] = dist[type][u] + 1;
q.push(v);
}
}
}
}
int main(){
#ifdef Futymy
freopen("SPY.inp", "r", stdin);
freopen("SPY.out", "w", stdout);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |