Submission #989614

#TimeUsernameProblemLanguageResultExecution timeMemory
989614AdamGSMini tetris (IOI16_tetris)C++17
100 / 100
2 ms604 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...