Submission #845314

# Submission time Handle Problem Language Result Execution time Memory
845314 2023-09-06T13:08:56 Z vjudge1 Konstrukcija (COCI20_konstrukcija) C++17
0 / 110
1 ms 348 KB
#include <bits/stdc++.h>
#define pb push_back
#define int int64_t
using namespace std;

constexpr static int MXLOG = 62;

int32_t main()
{
	int k;
	cin >> k;
	vector<int> v;
	int nxt = 0;
	v.pb(nxt++);
	vector<array<int, 2>> e;
	for (int i = 1; i < MXLOG; i++)
	{
		e.pb({v.back(), nxt++});
		e.pb({v.back(), nxt++});
		e.pb({nxt-2, nxt});
		e.pb({nxt-1, nxt});
		v.pb(nxt++);
	}
	for (int i = 0; i < MXLOG; i++)
	{
		if ((1<<i)&abs(k))
			e.pb({v[i], nxt});
	}
	nxt++;
	if (k > 0)
	{
		e.pb({nxt-1, nxt});
		nxt++;
	}
	cout << nxt << " " << e.size() << "\n";
	for (auto [a, b] : e)
	{
		cout << (a+1) << " " << (b+1) << "\n";
	}
}

# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -