Submission #705360

# Submission time Handle Problem Language Result Execution time Memory
705360 2023-03-04T06:32:38 Z Chal1shkan Logičari (COCI21_logicari) C++14
10 / 110
47 ms 28108 KB
# include <bits/stdc++.h>
 
# define pb push_back
# define ff first
# define ss second
# define nl "\n"
# define sz(x) ((int)(x).size())
# define deb(x) cerr << #x  << " = " << x << endl; 
# define pll pair <ll, ll>
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const ll maxn = 1e6 + 25;
const ll inf = 1e18 + 0;
const ll mod = 1e9 + 123;
const ll dx[] = {-1, 1, 0, 0};
const ll dy[] = {0, 0, -1, 1};
 
using namespace std;

ll n;
vector <ll> g[maxn];

void ma1n (/* SABR */)
{
	cin >> n;
	for (ll i = 1, u, v; i <= n; ++i)
	{
		cin >> u >> v;
		g[u].pb(v);
		g[v].pb(u);
	}
	if (n % 4 == 0)
	{
		cout << n / 2 << nl;
	}
	else
	{
		cout << -1 << nl;
	}
}
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
//  freopen("spainting.in", "r", stdin);
//  freopen("spainting.out", "w", stdout);
    int ttt = 1;
//  cin >> ttt;
    for (int test = 1; test <= ttt; ++test)
    {
//      cout << "Case " << test << ":" << ' ';
        ma1n();
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23708 KB Output is correct
2 Correct 11 ms 23716 KB Output is correct
3 Correct 12 ms 23764 KB Output is correct
4 Correct 11 ms 23732 KB Output is correct
5 Correct 43 ms 27952 KB Output is correct
6 Correct 41 ms 28032 KB Output is correct
7 Correct 45 ms 28040 KB Output is correct
8 Correct 47 ms 28108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23708 KB Output is correct
2 Correct 11 ms 23716 KB Output is correct
3 Correct 12 ms 23764 KB Output is correct
4 Correct 11 ms 23732 KB Output is correct
5 Correct 43 ms 27952 KB Output is correct
6 Correct 41 ms 28032 KB Output is correct
7 Correct 45 ms 28040 KB Output is correct
8 Correct 47 ms 28108 KB Output is correct
9 Incorrect 11 ms 23764 KB Output isn't correct
10 Halted 0 ms 0 KB -