Submission #405919

#TimeUsernameProblemLanguageResultExecution timeMemory
405919Maqsut_03Swapping Cities (APIO20_swap)C++14
0 / 100
156 ms14328 KiB
#include "swap.h" #include<iostream> #include<vector> #include<algorithm> #include<map> #include<set> #include<queue> #include<deque> #define ll long long #define pl pair<ll, ll> #define llv vector<ll> #define pb push_back #define ppb(x, y) push_back({x, y}) #define pv vector<pl> #define sz size() using namespace std; const int N = 2 * 1e5 + 3; int n, m, a = 0, b = 0; pv v[N]; bool q = 1; 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++) { v[V[i]].ppb(U[i], W[i]); v[U[i]].ppb(V[i], W[i]); } for (int i=0; i<n; i++) { if (v[i].sz == 2) a++; if (v[i].sz == 1) b++; } if (b == 2 && a + b == n) q = 0; return ; } int getMinimumFuelCapacity(int X, int Y) { if (q) { return 1; } else 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...