# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
668570 | RambaXGorilla | 007 (CEOI14_007) | C++17 | 301 ms | 16444 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<cstdio>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
using namespace std;
typedef pair <int,int> ii;
int N, M, S, D, A, B;
vector <int> adj[200010];
queue <ii> near;
int dists[2][200010] = {};
bool vis[200010] = {};
void bfs(int X, int n){
near.push(ii(X, 0));
while(!near.empty()){
int node = near.front().first;
int dist = near.front().second;
near.pop();
if(dists[n][node]) continue;
dists[n][node] = dist;
for(int i : adj[node]){
near.push(ii(i, dist + 1));
}
}
}
int both(int X){
int most;
near.push(ii(X, 0));
while(!near.empty()){
int node = near.front().first;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |