# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120374 | tinder | Port Facility (JOI17_port_facility) | C++14 | 6081 ms | 41212 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;
using ii = pair<int, int>;
const int maxn = 1e6 + 6;
int n, s[maxn], t[maxn];
vector<int> g[maxn];
int lvl[maxn], vis[maxn];
bool check(int source) {
queue<int> Q;
vis[source] = 1;
Q.push(source);
while(Q.size()) {
int u = Q.front();
Q.pop();
for(int v : g[u]) {
if(vis[v]) {
if(lvl[v] == lvl[u]) {
return false;
}
} else {
lvl[v] = lvl[u] + 1;
vis[v] = 1;
Q.push(v);
}
}
} return true;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |