# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77023 | win11905 | One-Way Streets (CEOI17_oneway) | C++11 | 123 ms | 13036 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 pii pair<int, int>
#define x first
#define y second
using namespace std;
const int N = 1e5+5;
int n, m, p, d1[N], d2[N];
char Answer[N];
bitset<N> check, checkE;
pii E[N];
vector<pii> g[N];
void dfs(int u, int p) {
check[u] = true;
for(pii v : g[u]) if(v.x != p) {
if(check[v.x]) { if(E[v.y].x == u) swap(E[v.y].x, E[v.y].y); }
else checkE[v.y] = true, dfs(v.x, u);
}
}
void solve(int u, int p) {
check[u] = false;
for(pii v : g[u]) if(v.x != p and check[v.x]) {
solve(v.x, u);
Answer[v.y] = 'B';
d1[u] += d1[v.x], d2[u] += d2[v.x];
if(d1[v.x] || !d2[v.x]) continue;
Answer[v.y] = (d2[v.x] > 0 ? v.x : u) == E[v.y].x ? 'R' : 'L';
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... |