# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305319 | Fdg | Stations (IOI20_stations) | C++14 | 1117 ms | 1136 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>
#include <map>
#include <set>
#include <algorithm>
#include <memory.h>
using namespace std;
vector<int> g[1002];
vector<int> color;
bool used[1002];
int ptr;
void dfs(int v, bool markFirst) {
used[v] = true;
if (markFirst) color[v] = ptr++;
for (int x : g[v])
if (!used[x]) dfs(x, !markFirst);
if (!markFirst) color[v] = ptr++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
for (int i = 0; i < n; ++i) g[i].clear();
for (int i = 0; i < u.size(); ++i) {
g[u[i]].push_back(v[i]);
g[v[i]].push_back(u[i]);
}
ptr = 0;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |