# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83999 | aminra | 007 (CEOI14_007) | C++17 | 406 ms | 45648 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;
typedef long long ll;
typedef long double ld;
const int infint = 1e9;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e6 + 7;
int dist1[MAXN], dist2[MAXN], dist3[MAXN], n, m, s, d, a, b;
vector<int> G[MAXN];
void bfs(int s, int type)
{
if(type == 0)
dist1[s] = 0;
else
if(type == 1)
dist2[s] = 0;
else
dist3[s] = 0;
queue<int> q;
q.push(s);
while(!q.empty())
{
int st = q.front();
q.pop();
for (auto v : G[st])
{
if(type == 0 && dist1[v] == -1)
dist1[v] = dist1[st] + 1, q.push(v);
else
if(type == 1 && dist2[v] == -1)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |