Submission #845360

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

constexpr static int MXLOG = 31;

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 ((static_cast<int>(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 0 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 0 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -