Submission #1236606

#TimeUsernameProblemLanguageResultExecution timeMemory
1236606Hamed_GhaffariMini tetris (IOI16_tetris)C++20
100 / 100
2 ms328 KiB
#include "tetris.h"

void init(int n) {
}

int nxt1[6] = {3, 0, 0, 2, 1, 3};
int pos1[6] = {0, 1, 0, 2, 0, 1};
int rot1[6] = {0, 0, 0, 1, 1, 0};
int nxt2[6] = {5, 2, 1, 4, 3, 0};
int pos2[6] = {0, 1, 0, 1, 0, 1};
int rot2[6] = {0, 1, 0, 2, 3, 2};
int position;
int rotation;
int cur;

void new_figure(int figure_type) {
	if(figure_type==1) position = rotation = 0;
	else if(figure_type==2) {
		position = pos1[cur];
		rotation = rot1[cur];
		cur = nxt1[cur];
	}
	else {
		position = pos2[cur];
		rotation = rot2[cur];
		cur = nxt2[cur];
	}
}

int get_position() {
	return position;
}

int get_rotation() {
	return rotation;
}

Compilation message (stderr)

tetris.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
tetris_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#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...