Submission #516804

#TimeUsernameProblemLanguageResultExecution timeMemory
516804Marslai24Logičari (COCI21_logicari)C++17
10 / 110
43 ms6804 KiB
#include <bits/stdc++.h> using namespace std; #define int long long // a.k.a. TLE creator #define all(x) x.begin(), x.end() template<class A, class B> istream& operator >>(istream &o, pair<A, B> &x){return o >> x.first >> x.second;} template<class A, class B> ostream& operator <<(ostream &o, pair<A, B> &x){return o << x.first << ' ' << x.second << ' ';} void setIO(){ios::sync_with_stdio(false); cin.tie(0);} const int INF = INT_MAX, MOD = 998244353, N = 1e5 + 2, K = __lg(N) + 1; signed main(){ setIO(); int n; cin >> n; vector<int> adj[N]; for(int i = 0; i < n; i++){ int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } cout << (n % 4 == 0 ? n / 2 : -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...