Submission #963210

#TimeUsernameProblemLanguageResultExecution timeMemory
963210SuPythonySwapping Cities (APIO20_swap)C++17
0 / 100
74 ms15948 KiB
#include "swap.h" #include <bits/stdc++.h> using namespace std; vector<vector<pair<int,int>>> al; int mn=1e9; int n,m; vector<int> ew; void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) { al.assign(N+1,vector<pair<int,int>>()); ew.assign(N+1,0); for (int i=0; i<M; i++) { al[U[i]].push_back({V[i],W[i]}); al[V[i]].push_back({U[i],W[i]}); ew[V[i]]=W[i]; mn=min(mn,W[i]); } n=N; m=M; } int getMinimumFuelCapacity(int X, int Y) { if (m<=2) return -1; return max({mn,ew[X],ew[Y]}); }
#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...