Submission #522076

# Submission time Handle Problem Language Result Execution time Memory
522076 2022-02-03T18:41:16 Z tabr Mini tetris (IOI16_tetris) C++17
46 / 100
2 ms 292 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int pos;
int rot;
int state;

void init(int) {
    state = -1;
}

void new_figure(int type) {
    if (type == 1) {
        pos = 0;
        rot = 0;
    } else if (type == 2) {
        if (state == -1) {
            pos = 0;
            rot = 0;
            state = 2;
        } else if (state < 2) {
            pos = 1 ^ state;
            rot = 0;
            state += 2;
        } else if (state < 4) {
            pos = state % 3;
            rot = 1;
            state = 7 - state;
        } else {
            pos = 5 - state;
            rot = 0;
            state = -1;
        }
    } else {
        if (state == -1) {
            pos = 0;
            rot = 0;
            state = 0;
        } else if (state < 2) {
            pos = 1 ^ state;
            rot = 2 + state;
            state = -1;
        } else if (state < 4) {
            pos = 1 ^ (state % 2);
            rot = 2 + state;
            state ^= 1;
        } else {
            pos = 5 - state;
            rot = 5 - state;
            state ^= 1;
        }
    }
}

int get_position() {
    return pos;
}

int get_rotation() {
    return rot;
}

#ifdef tabr
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    return 0;
}
#endif
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Win!
2 Correct 0 ms 204 KB Win!
3 Correct 1 ms 292 KB Win!
4 Correct 1 ms 204 KB Win!
5 Correct 1 ms 204 KB Win!
6 Correct 1 ms 292 KB Win!
7 Correct 1 ms 204 KB Win!
8 Correct 2 ms 204 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Win!
2 Correct 0 ms 204 KB Win!
3 Correct 0 ms 204 KB Win!
4 Correct 1 ms 204 KB Win!
5 Correct 1 ms 204 KB Win!
6 Correct 1 ms 288 KB Win!
7 Correct 1 ms 204 KB Win!
8 Correct 2 ms 204 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Win!
2 Correct 0 ms 204 KB Win!
3 Correct 1 ms 292 KB Win!
4 Correct 1 ms 204 KB Win!
5 Correct 1 ms 204 KB Win!
6 Correct 1 ms 292 KB Win!
7 Correct 1 ms 204 KB Win!
8 Correct 2 ms 204 KB Win!
9 Correct 0 ms 204 KB Win!
10 Correct 0 ms 204 KB Win!
11 Correct 0 ms 204 KB Win!
12 Correct 1 ms 204 KB Win!
13 Correct 1 ms 204 KB Win!
14 Correct 1 ms 288 KB Win!
15 Correct 1 ms 204 KB Win!
16 Correct 2 ms 204 KB Win!
17 Correct 1 ms 204 KB Win!
18 Correct 0 ms 204 KB Win!
19 Correct 0 ms 204 KB Win!
20 Correct 1 ms 204 KB Win!
21 Correct 1 ms 204 KB Win!
22 Correct 1 ms 204 KB Win!
23 Correct 1 ms 204 KB Win!
24 Correct 2 ms 204 KB Win!
25 Correct 2 ms 204 KB Win!
26 Correct 2 ms 204 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Win!
2 Correct 0 ms 204 KB Win!
3 Correct 1 ms 204 KB Win!
4 Correct 1 ms 204 KB Win!
5 Correct 1 ms 204 KB Win!
6 Correct 1 ms 204 KB Win!
7 Correct 1 ms 204 KB Win!
8 Correct 2 ms 204 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Win!
2 Correct 0 ms 204 KB Win!
3 Correct 1 ms 292 KB Win!
4 Correct 1 ms 204 KB Win!
5 Correct 1 ms 204 KB Win!
6 Correct 1 ms 292 KB Win!
7 Correct 1 ms 204 KB Win!
8 Correct 2 ms 204 KB Win!
9 Correct 0 ms 204 KB Win!
10 Correct 0 ms 204 KB Win!
11 Correct 0 ms 204 KB Win!
12 Correct 1 ms 204 KB Win!
13 Correct 1 ms 204 KB Win!
14 Correct 1 ms 288 KB Win!
15 Correct 1 ms 204 KB Win!
16 Correct 2 ms 204 KB Win!
17 Correct 1 ms 204 KB Win!
18 Correct 0 ms 204 KB Win!
19 Correct 0 ms 204 KB Win!
20 Correct 1 ms 204 KB Win!
21 Correct 1 ms 204 KB Win!
22 Correct 1 ms 204 KB Win!
23 Correct 1 ms 204 KB Win!
24 Correct 2 ms 204 KB Win!
25 Correct 2 ms 204 KB Win!
26 Correct 2 ms 204 KB Win!
27 Correct 1 ms 288 KB Win!
28 Correct 0 ms 204 KB Win!
29 Correct 1 ms 204 KB Win!
30 Correct 1 ms 204 KB Win!
31 Correct 1 ms 204 KB Win!
32 Correct 1 ms 204 KB Win!
33 Correct 1 ms 204 KB Win!
34 Correct 2 ms 204 KB Win!
35 Correct 0 ms 204 KB Win!
36 Correct 1 ms 204 KB Win!
37 Correct 1 ms 204 KB Win!
38 Incorrect 0 ms 204 KB Integer 4 violates the range [0, 3]
39 Halted 0 ms 0 KB -