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;
const int M = 1e5+5;
vector<pair<int, int>> node[M];
vector<array<int, 3>> E;
int n, m;
int mx = 0, cycle = 3;
void init(int _n, int _m, vector<int> U, vector<int> V, vector<int> W) {
n = _n, m = _m;
for (int i = 0; i < m; i++) E.push_back({U[i], V[i], W[i]});
for (auto [a, b, c]:E)
node[a].push_back({b, c}),
node[b].push_back({a, c});
for (int i = 0; i < n; i++) cycle = min(cycle, (int)node[i].size());
for (auto [a, b, c]:E) mx = max(mx, c);
cycle = cycle > 1;
}
int getMinimumFuelCapacity(int X, int Y) {
// int x = solve(X, Y);
// if (x > 1e9) return -1;
// return x+1;
if (cycle) return mx;
return -1;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |