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;
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 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... |