# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375383 | gustason | Fire drill (LMIO18_sauga) | C++14 | 964 ms | 3096 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 ll = long long;
//mt19937 rnd(time(NULL));
const int maxN = 1005;
int best = 0;
vector<int> ans, seq, order;
int t, n, S;
vector<int> adj[maxN];
vector<char> col;
vector<bool> ok;
void dfs(int v) {
if (!ok[v]) return;
col[v] = '1';
for(int u : adj[v]) {
if (!ok[u]) continue;
// cout << v << "-> " << u << " " << col[u] << "\n";
if (col[u] == '0') {
dfs(u);
} else if (col[u] == '1') {
ok[v] = false;
return;
}
}
col[v] = '2';
seq.push_back(v);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |