# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
991107 | yellowtoad | Senior Postmen (BOI14_postmen) | C++17 | 605 ms | 25680 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 <iostream>
#include <vector>
#define f first
#define s second
using namespace std;
int n, m, vis[500010], viss[500010];
vector<pair<int,int>> edge[500010];
vector<vector<int>> path;
vector<int> pth;
bool dfs(int u, int tar, int can) {
pth.push_back(u);
if ((u == tar) && (can)) {
path.push_back(pth);
return 1;
}
for (int i = 0; i < edge[u].size(); i++) {
if (!vis[edge[u][i].s]) {
vis[edge[u][i].s] = 1;
return dfs(edge[u][i].f,tar,1);
}
}
return 0;
}
void solve(int u) {
pth.clear();
if (!dfs(u,u,0)) return;
int iter = path.size()-1;
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... |