Submission #741818

#TimeUsernameProblemLanguageResultExecution timeMemory
7418181zaid1Swapping Cities (APIO20_swap)C++17
6 / 100
110 ms16900 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...