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;
int n;
vector<int>g[100005];
void fun()
{
cin>>n;
for(int i = 1, a, b; i <= n; i++)
{
cin>>a>>b;
g[a].push_back(b);
g[b].push_back(a);
}
cout<<((n % 4 == 0) ? n / 2 : -1);
}
int main()
{
int ttt = 1;
//cin>>ttt;
while(ttt--)
fun();
}
# | 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... |