This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "tetris_c.h"
/*
* 0 1 2 3 4 5
* ... ... ... ... ... x..
* ... x.. ..x xx. .xx xx.
*/
int tt[][3] = { { 0, 2, 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 } };
static 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 (stderr)
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |