답안 #516804

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
516804 2022-01-22T06:42:16 Z Marslai24 Logičari (COCI21_logicari) C++17
10 / 110
43 ms 6804 KB
#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);
}


# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2656 KB Output is correct
4 Correct 1 ms 2636 KB Output is correct
5 Correct 37 ms 6720 KB Output is correct
6 Correct 38 ms 6748 KB Output is correct
7 Correct 43 ms 6724 KB Output is correct
8 Correct 41 ms 6804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2656 KB Output is correct
4 Correct 1 ms 2636 KB Output is correct
5 Correct 37 ms 6720 KB Output is correct
6 Correct 38 ms 6748 KB Output is correct
7 Correct 43 ms 6724 KB Output is correct
8 Correct 41 ms 6804 KB Output is correct
9 Incorrect 2 ms 2764 KB Output isn't correct
10 Halted 0 ms 0 KB -