# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384910 | izhang05 | Crocodile's Underground City (IOI11_crocodile) | C++17 | 177 ms | 262148 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 "crocodile.h"
#ifdef LOCAL
#include "crocodile_grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
//#define DEBUG
const int maxn = 1e3 + 5, inf = 1e9;
int sol[maxn];
bool ex[maxn];
vector<pair<int, int>> adj[maxn];
void dfs(int c, int p) {
vector<int> pos;
for (auto i : adj[c]) {
if (i.first != p) {
dfs(i.first, c);
pos.push_back(sol[i.first] + i.second);
}
}
sort(pos.begin(), pos.end());
if (pos.size() <= 1) {
sol[c] = -inf;
} else {
sol[c] = pos[1];
}
if (ex[c]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |