Submission #482207

# Submission time Handle Problem Language Result Execution time Memory
482207 2021-10-23T16:58:30 Z rainboy Konstrukcija (COCI20_konstrukcija) C
30 / 110
1 ms 204 KB
#include <stdio.h>
 
#define N	1000
#define M	1000
#define L	10
 
int main() {
	static int ii[M], jj[M];
	int m, i, l, a, b;
	long long k;
 
	scanf("%lld", &k);
	m = 0;
	for (a = 1; a <= 3; a++)
		ii[m] = a, jj[m] = N - 1, m++;
	for (l = 1; l < L; l++)
		for (a = 1; a <= 3; a++)
			for (b = 1; b <= 3; b++)
				ii[m] = l * 3 + a, jj[m] = (l - 1) * 3 + b, m++;
	for (b = 1; b <= 3; b++)
		ii[m] = 0, jj[m] = (L - 1) * 3 + b, m++;
	k += (1LL << L);
	i = N - 2;
	for (l = L; l >= 0; l -= 2)
		while (k >= 1LL << l) {
			ii[m] = 0, jj[m] = i, m++;
			if (l > 0)
				for (b = 1; b <= 3; b++)
					ii[m] = i, jj[m] = (l - 1) * 3 + b, m++;
			else
				ii[m] = i, jj[m] = N - 1, m++;
			i--, k -= 1LL << l;
		}
	printf("1000 %d\n", m);
	while (m--)
		printf("%d %d\n", ii[m] + 1, jj[m] + 1);
	return 0;
}

Compilation message

konstrukcija.c: In function 'main':
konstrukcija.c:12:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  scanf("%lld", &k);
      |  ^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct.
2 Correct 1 ms 204 KB Correct.
3 Correct 0 ms 204 KB Correct.
4 Correct 0 ms 204 KB Correct.
5 Correct 0 ms 204 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct.
2 Correct 0 ms 204 KB Correct.
3 Correct 0 ms 204 KB Correct.
4 Correct 0 ms 204 KB Correct.
5 Correct 0 ms 204 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct.
2 Correct 1 ms 204 KB Correct.
3 Correct 0 ms 204 KB Correct.
4 Correct 0 ms 204 KB Correct.
5 Correct 0 ms 204 KB Correct.
6 Correct 0 ms 204 KB Correct.
7 Correct 0 ms 204 KB Correct.
8 Correct 0 ms 204 KB Correct.
9 Correct 0 ms 204 KB Correct.
10 Correct 0 ms 204 KB Correct.
11 Correct 1 ms 204 KB Correct.
12 Correct 0 ms 204 KB Correct.
13 Incorrect 0 ms 204 KB Wrong answer.
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct.
2 Correct 1 ms 204 KB Correct.
3 Correct 0 ms 204 KB Correct.
4 Correct 0 ms 204 KB Correct.
5 Correct 0 ms 204 KB Correct.
6 Correct 0 ms 204 KB Correct.
7 Correct 0 ms 204 KB Correct.
8 Correct 0 ms 204 KB Correct.
9 Correct 0 ms 204 KB Correct.
10 Correct 0 ms 204 KB Correct.
11 Correct 1 ms 204 KB Correct.
12 Correct 0 ms 204 KB Correct.
13 Incorrect 0 ms 204 KB Wrong answer.
14 Halted 0 ms 0 KB -