Submission #926382

# Submission time Handle Problem Language Result Execution time Memory
926382 2024-02-12T21:01:59 Z rainboy Mini tetris (IOI16_tetris) C
100 / 100
1 ms 504 KB
#include "tetris_c.h"

/*
 *  0   1   2   3   4   5
 * ... ... ... ... ... x..
 * ... x.. ..x xx. .xx xx.
 */

int tt[][3] = { { 0, 3, 5 }, { 1, 0, 2 }, { 2, 0, 1 }, { 3, 2, 4 }, { 4, 1, 3 }, { 5, 3, 0 } };
int pp[][3] = { { 0, 0, 0 }, { 0, 1, 1 }, { 0, 0, 0 }, { 0, 2, 1 }, { 0, 0, 0 }, { 0, 1, 1 } };
int rr[][3] = { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 1, 2 }, { 0, 1, 3 }, { 0, 0, 2 } };

int s, p, r;

void init(int n) {
	s = 0, p = r = -1;
}

void new_figure(int c) {
	c--;
	p = pp[s][c], r = rr[s][c], s = tt[s][c];
}

int get_position() {
	return p;
}

int get_rotation() {
	return r;
}

Compilation message

grader.c: In function 'main':
grader.c:10:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d", &n);
      |     ^~~~~~~~~~~~~~~
grader.c:12:6: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |      scanf("%d", &a[i]);
      |      ^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Win!
2 Correct 0 ms 348 KB Win!
3 Correct 1 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 1 ms 504 KB Win!
6 Correct 0 ms 344 KB Win!
7 Correct 0 ms 348 KB Win!
8 Correct 0 ms 348 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Win!
2 Correct 0 ms 348 KB Win!
3 Correct 0 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 0 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 0 ms 348 KB Win!
8 Correct 1 ms 348 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Win!
2 Correct 0 ms 348 KB Win!
3 Correct 1 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 1 ms 504 KB Win!
6 Correct 0 ms 344 KB Win!
7 Correct 0 ms 348 KB Win!
8 Correct 0 ms 348 KB Win!
9 Correct 0 ms 344 KB Win!
10 Correct 0 ms 348 KB Win!
11 Correct 0 ms 348 KB Win!
12 Correct 0 ms 348 KB Win!
13 Correct 0 ms 348 KB Win!
14 Correct 0 ms 348 KB Win!
15 Correct 0 ms 348 KB Win!
16 Correct 1 ms 348 KB Win!
17 Correct 0 ms 348 KB Win!
18 Correct 1 ms 420 KB Win!
19 Correct 0 ms 348 KB Win!
20 Correct 0 ms 348 KB Win!
21 Correct 0 ms 348 KB Win!
22 Correct 0 ms 348 KB Win!
23 Correct 0 ms 344 KB Win!
24 Correct 0 ms 348 KB Win!
25 Correct 1 ms 348 KB Win!
26 Correct 1 ms 348 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Win!
2 Correct 0 ms 348 KB Win!
3 Correct 0 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 0 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 0 ms 348 KB Win!
8 Correct 0 ms 348 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Win!
2 Correct 0 ms 348 KB Win!
3 Correct 1 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 1 ms 504 KB Win!
6 Correct 0 ms 344 KB Win!
7 Correct 0 ms 348 KB Win!
8 Correct 0 ms 348 KB Win!
9 Correct 0 ms 344 KB Win!
10 Correct 0 ms 348 KB Win!
11 Correct 0 ms 348 KB Win!
12 Correct 0 ms 348 KB Win!
13 Correct 0 ms 348 KB Win!
14 Correct 0 ms 348 KB Win!
15 Correct 0 ms 348 KB Win!
16 Correct 1 ms 348 KB Win!
17 Correct 0 ms 348 KB Win!
18 Correct 1 ms 420 KB Win!
19 Correct 0 ms 348 KB Win!
20 Correct 0 ms 348 KB Win!
21 Correct 0 ms 348 KB Win!
22 Correct 0 ms 348 KB Win!
23 Correct 0 ms 344 KB Win!
24 Correct 0 ms 348 KB Win!
25 Correct 1 ms 348 KB Win!
26 Correct 1 ms 348 KB Win!
27 Correct 0 ms 348 KB Win!
28 Correct 0 ms 348 KB Win!
29 Correct 0 ms 348 KB Win!
30 Correct 0 ms 348 KB Win!
31 Correct 0 ms 348 KB Win!
32 Correct 0 ms 348 KB Win!
33 Correct 0 ms 348 KB Win!
34 Correct 0 ms 348 KB Win!
35 Correct 1 ms 428 KB Win!
36 Correct 0 ms 348 KB Win!
37 Correct 0 ms 348 KB Win!
38 Correct 1 ms 348 KB Win!
39 Correct 0 ms 348 KB Win!
40 Correct 1 ms 348 KB Win!
41 Correct 0 ms 348 KB Win!
42 Correct 0 ms 348 KB Win!
43 Correct 0 ms 348 KB Win!
44 Correct 0 ms 348 KB Win!
45 Correct 0 ms 348 KB Win!