#include <bits/stdc++.h>
#include "tetris.h"
using namespace std;
void init(int n) {
}
int position;
int rotation;
int figure, lastpos = -1, it = 2;
void new_figure(int figure_type) {
figure = figure_type;
}
int get_position() {
if(figure == 1) position = 0;
else{
if(figure == 2){
if(lastpos == 2) lastpos = -1;
position = lastpos + 1;
lastpos++;
}else{
if(it % 2 == 0){
position = 1;
it++;
}else{
position = 0;
it++;
}
}
}
return position;
}
int get_rotation() {
if(figure == 1) rotation = 0;
else{
if(figure == 2) rotation = 1;
else{
if(it % 2 == 0){
rotation = 1;
}else{
rotation = 3;
}
}
}
return rotation;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
376 KB |
Win! |
2 |
Correct |
2 ms |
256 KB |
Win! |
3 |
Correct |
2 ms |
376 KB |
Win! |
4 |
Correct |
3 ms |
256 KB |
Win! |
5 |
Correct |
2 ms |
256 KB |
Win! |
6 |
Correct |
3 ms |
256 KB |
Win! |
7 |
Correct |
4 ms |
256 KB |
Win! |
8 |
Correct |
4 ms |
376 KB |
Win! |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Win! |
2 |
Correct |
2 ms |
256 KB |
Win! |
3 |
Correct |
2 ms |
296 KB |
Win! |
4 |
Correct |
3 ms |
376 KB |
Win! |
5 |
Correct |
2 ms |
376 KB |
Win! |
6 |
Correct |
3 ms |
256 KB |
Win! |
7 |
Correct |
4 ms |
256 KB |
Win! |
8 |
Correct |
5 ms |
256 KB |
Win! |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
376 KB |
Win! |
2 |
Correct |
2 ms |
256 KB |
Win! |
3 |
Correct |
2 ms |
376 KB |
Win! |
4 |
Correct |
3 ms |
256 KB |
Win! |
5 |
Correct |
2 ms |
256 KB |
Win! |
6 |
Correct |
3 ms |
256 KB |
Win! |
7 |
Correct |
4 ms |
256 KB |
Win! |
8 |
Correct |
4 ms |
376 KB |
Win! |
9 |
Correct |
2 ms |
256 KB |
Win! |
10 |
Correct |
2 ms |
256 KB |
Win! |
11 |
Correct |
2 ms |
296 KB |
Win! |
12 |
Correct |
3 ms |
376 KB |
Win! |
13 |
Correct |
2 ms |
376 KB |
Win! |
14 |
Correct |
3 ms |
256 KB |
Win! |
15 |
Correct |
4 ms |
256 KB |
Win! |
16 |
Correct |
5 ms |
256 KB |
Win! |
17 |
Correct |
2 ms |
256 KB |
Win! |
18 |
Correct |
2 ms |
256 KB |
Win! |
19 |
Correct |
3 ms |
256 KB |
Win! |
20 |
Correct |
3 ms |
256 KB |
Win! |
21 |
Correct |
3 ms |
252 KB |
Win! |
22 |
Correct |
3 ms |
256 KB |
Win! |
23 |
Correct |
3 ms |
252 KB |
Win! |
24 |
Correct |
5 ms |
376 KB |
Win! |
25 |
Correct |
5 ms |
376 KB |
Win! |
26 |
Correct |
5 ms |
256 KB |
Win! |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Game over! After 3 turns. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
376 KB |
Win! |
2 |
Correct |
2 ms |
256 KB |
Win! |
3 |
Correct |
2 ms |
376 KB |
Win! |
4 |
Correct |
3 ms |
256 KB |
Win! |
5 |
Correct |
2 ms |
256 KB |
Win! |
6 |
Correct |
3 ms |
256 KB |
Win! |
7 |
Correct |
4 ms |
256 KB |
Win! |
8 |
Correct |
4 ms |
376 KB |
Win! |
9 |
Correct |
2 ms |
256 KB |
Win! |
10 |
Correct |
2 ms |
256 KB |
Win! |
11 |
Correct |
2 ms |
296 KB |
Win! |
12 |
Correct |
3 ms |
376 KB |
Win! |
13 |
Correct |
2 ms |
376 KB |
Win! |
14 |
Correct |
3 ms |
256 KB |
Win! |
15 |
Correct |
4 ms |
256 KB |
Win! |
16 |
Correct |
5 ms |
256 KB |
Win! |
17 |
Correct |
2 ms |
256 KB |
Win! |
18 |
Correct |
2 ms |
256 KB |
Win! |
19 |
Correct |
3 ms |
256 KB |
Win! |
20 |
Correct |
3 ms |
256 KB |
Win! |
21 |
Correct |
3 ms |
252 KB |
Win! |
22 |
Correct |
3 ms |
256 KB |
Win! |
23 |
Correct |
3 ms |
252 KB |
Win! |
24 |
Correct |
5 ms |
376 KB |
Win! |
25 |
Correct |
5 ms |
376 KB |
Win! |
26 |
Correct |
5 ms |
256 KB |
Win! |
27 |
Incorrect |
2 ms |
256 KB |
Game over! After 3 turns. |
28 |
Halted |
0 ms |
0 KB |
- |