This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "tetris.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> wgraf;
typedef pair<int,ii> edge;
typedef vector <ll> vl;
typedef pair <ll, ll> LL;
typedef vector <LL> vll;
#define UNVISITED 0
#define VISITED 1
#define pb push_back
#define F first
#define S second
bool libre[3], libre2[3];
void init(int n) {
libre[0] = true;
libre[1] = true;
libre[2] = true;
libre2[0] = true;
libre2[1] = true;
libre2[2] = true;
}
ll pos = 0, rot = 0, cnt = 0;
void new_figure(int figure_type) {
if (figure_type == 1){
pos = 0;
rot = 0;
} else if (figure_type == 2){
for (ll i = 0; i < 3; i++) if (libre[i] == true) cnt++;
if (cnt >= 2) {
if (libre[0] == true) pos = 0;
else pos = 1;
rot = 0;
if (cnt == 2) {
libre[0] = libre2[0];
libre[1] = libre2[1];
libre[2] = libre2[2];
libre2[0] = true;
libre2[1] = true;
libre2[2] = true;
} else {
libre[pos] = false;
libre[pos + 1] = false;
}
} else {
if (libre[0] == true) pos = 0;
else pos = 2;
rot = 1;
libre[0] = libre2[0];
libre[1] = libre2[1];
libre[2] = libre2[2];
libre[pos] = false;
}
} else {
}
}
int get_position() {
return pos;
}
int get_rotation() {
return rot;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |