#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define int long long
using namespace std;
const int N = 1e5+5;
vector<int> adj[N];
signed main(){
fastio
int n;
cin >> n;
for(int i = 1;i <= n;i++){
int u,v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
cout << (n%4==0 ? 2*n/4 : -1) << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2672 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
33 ms |
6928 KB |
Output is correct |
6 |
Correct |
31 ms |
6924 KB |
Output is correct |
7 |
Correct |
31 ms |
6860 KB |
Output is correct |
8 |
Correct |
30 ms |
6856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2644 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2644 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2672 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
33 ms |
6928 KB |
Output is correct |
6 |
Correct |
31 ms |
6924 KB |
Output is correct |
7 |
Correct |
31 ms |
6860 KB |
Output is correct |
8 |
Correct |
30 ms |
6856 KB |
Output is correct |
9 |
Incorrect |
1 ms |
2644 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |