# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
110519 | ckodser | 007 (CEOI14_007) | C++14 | 534 ms | 23556 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>
#define pb push_back
using namespace std;
const int N = 200005;
int n, m, a, b, s1, s2, D[2][N], F[N], P[N];
vector < int > vec[N], Adj[N];
inline void BFS(int st, int w, int tp = 0)
{
queue < int > qu;
qu.push(st); D[w][st] = 0;
while (qu.size())
{
int v = qu.front();
qu.pop();
if (tp) vec[D[w][v]].pb(v);
for (int &u : Adj[v])
if (D[w][u] == -1)
D[w][u] = D[w][v] + 1, qu.push(u);
}
}
inline bool Check(int s, int t)
{
if (D[0][t] < D[0][s] || D[1][t] < D[1][s])
return 0;
if (D[0][s] < D[0][t] || D[1][s] < D[1][t])
return 1;
return (F[s] <= F[t]);
}
inline bool CMP(int i, int j)
{
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |