Submission #569521

#TimeUsernameProblemLanguageResultExecution timeMemory
569521niloyrootSwapping Cities (APIO20_swap)C++14
6 / 100
97 ms12952 KiB
#include <bits/stdc++.h> using namespace std; using ll = int; //long long; using vi = vector<ll>; using pl = pair<ll,ll>; #define pb push_back #define form(m,it) for(auto it=m.begin(); it!=m.end(); it++) #define forp(i,a,b) for(ll i=a; i<=b; i++) #define forn(i,a,b) for(ll i=a; i>=b; i--) #define newl '\n' #define ff first #define ss second const ll mod = 1000000007; vi adj[100005]; bool g=0; ll mx=-1; void init(ll N, ll M, vector<ll> U, vector<ll> V, vector<ll> W){ ll cnt[N+1]={0}; for(auto u:U){ cnt[u]++; } for(auto u:V){ cnt[u]++; } for(auto u:W){ mx=max(mx,u); } forp(i,0,N-1){ if(cnt[i]!=2){ g=1; } } } ll getMinimumFuelCapacity(ll X, ll Y){ if(g){ return -1; } return mx; }
#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...