# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570490 | AlesL0 | Race (IOI11_race) | C++17 | 3079 ms | 52276 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.
#pragma GCC optimize("03")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e6;
int current, siz, k, timer = 0, sol = INF;
vector <pair<int, int>> updates;
void get_size(int c, vector <int> g[], bool b[], int s[]){
s[c] = 1; b[c] = 1; siz++;
for (int i = 0; i < g[c].size(); i++){
if (!b[g[c][i]]){
int h = g[c][i]; get_size(h, g, b, s);
s[c] += s[h];
}
}
b[c] = 0;
}
void dfs(int c, vector <int> g[], bool b[], int s[]){
b[c] = 1; int m = 0;
for (int i = 0; i < g[c].size(); i++){
if (!b[g[c][i]]){
int h = g[c][i]; dfs(h, g, b, s);
m = max(m, s[h]);
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... |