답안 #989614

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
989614 2024-05-28T12:09:50 Z AdamGS Mini tetris (IOI16_tetris) C++17
100 / 100
2 ms 604 KB
#include "tetris.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
int nxt[6][2], nxtpos[6][2], nxtrot[6][2], pos, rot, akt;
void init(int n) {
  akt=0;
  nxt[0][0]=2; nxtpos[0][0]=0; nxtrot[0][0]=0;
  nxt[0][1]=1; nxtpos[0][1]=1; nxtrot[0][1]=1;

  nxt[1][0]=3; nxtpos[1][0]=0; nxtrot[1][0]=0;
  nxt[1][1]=0; nxtpos[1][1]=0; nxtrot[1][1]=3;

  nxt[2][0]=4; nxtpos[2][0]=2; nxtrot[2][0]=1;
  nxt[2][1]=3; nxtpos[2][1]=1; nxtrot[2][1]=2;

  nxt[3][0]=5; nxtpos[3][0]=0; nxtrot[3][0]=1; 
  nxt[3][1]=2; nxtpos[3][1]=0; nxtrot[3][1]=3;

  nxt[4][0]=0; nxtpos[4][0]=0; nxtrot[4][0]=0;
  nxt[4][1]=5; nxtpos[4][1]=0; nxtrot[4][1]=0;

  nxt[5][0]=0; nxtpos[5][0]=1; nxtrot[5][0]=0;
  nxt[5][1]=4; nxtpos[5][1]=1; nxtrot[5][1]=1;
}
void new_figure(int x) {
  if(x==1) {
    pos=rot=0;
    return;
  }
  x-=2;
  pos=nxtpos[akt][x];
  rot=nxtrot[akt][x];
  akt=nxt[akt][x];
}
int get_position() {
  return pos;
}
int get_rotation() {
  return rot;
}
# 결과 실행 시간 메모리 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 1 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 1 ms 348 KB Win!
8 Correct 1 ms 348 KB Win!
# 결과 실행 시간 메모리 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 1 ms 440 KB Win!
5 Correct 0 ms 348 KB Win!
6 Correct 1 ms 344 KB Win!
7 Correct 1 ms 348 KB Win!
8 Correct 1 ms 348 KB Win!
# 결과 실행 시간 메모리 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 1 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 1 ms 348 KB Win!
8 Correct 1 ms 348 KB Win!
9 Correct 0 ms 348 KB Win!
10 Correct 0 ms 348 KB Win!
11 Correct 0 ms 348 KB Win!
12 Correct 1 ms 440 KB Win!
13 Correct 0 ms 348 KB Win!
14 Correct 1 ms 344 KB Win!
15 Correct 1 ms 348 KB Win!
16 Correct 1 ms 348 KB Win!
17 Correct 0 ms 348 KB Win!
18 Correct 0 ms 348 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 1 ms 348 KB Win!
24 Correct 1 ms 348 KB Win!
25 Correct 1 ms 348 KB Win!
26 Correct 1 ms 348 KB Win!
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 604 KB Win!
2 Correct 1 ms 348 KB Win!
3 Correct 0 ms 348 KB Win!
4 Correct 0 ms 348 KB Win!
5 Correct 1 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 1 ms 348 KB Win!
8 Correct 2 ms 348 KB Win!
# 결과 실행 시간 메모리 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 1 ms 348 KB Win!
6 Correct 0 ms 348 KB Win!
7 Correct 1 ms 348 KB Win!
8 Correct 1 ms 348 KB Win!
9 Correct 0 ms 348 KB Win!
10 Correct 0 ms 348 KB Win!
11 Correct 0 ms 348 KB Win!
12 Correct 1 ms 440 KB Win!
13 Correct 0 ms 348 KB Win!
14 Correct 1 ms 344 KB Win!
15 Correct 1 ms 348 KB Win!
16 Correct 1 ms 348 KB Win!
17 Correct 0 ms 348 KB Win!
18 Correct 0 ms 348 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 1 ms 348 KB Win!
24 Correct 1 ms 348 KB Win!
25 Correct 1 ms 348 KB Win!
26 Correct 1 ms 348 KB Win!
27 Correct 0 ms 604 KB Win!
28 Correct 1 ms 348 KB Win!
29 Correct 0 ms 348 KB Win!
30 Correct 0 ms 348 KB Win!
31 Correct 1 ms 348 KB Win!
32 Correct 0 ms 348 KB Win!
33 Correct 1 ms 348 KB Win!
34 Correct 2 ms 348 KB Win!
35 Correct 0 ms 348 KB Win!
36 Correct 0 ms 432 KB Win!
37 Correct 1 ms 348 KB Win!
38 Correct 0 ms 348 KB Win!
39 Correct 0 ms 348 KB Win!
40 Correct 1 ms 348 KB Win!
41 Correct 1 ms 344 KB Win!
42 Correct 1 ms 348 KB Win!
43 Correct 1 ms 348 KB Win!
44 Correct 1 ms 348 KB Win!
45 Correct 1 ms 348 KB Win!