Submission #1073515

# Submission time Handle Problem Language Result Execution time Memory
1073515 2024-08-24T15:37:12 Z Osplei Mini tetris (IOI16_tetris) C++17
7 / 100
1 ms 348 KB
#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){
    if (libre[0] == true && libre[1] == true) {
      
      pos = 0;
      rot = 0;
      libre[0] = false;
      libre[1] = false;
      
      if (libre[2] == true) {
        libre[0] = libre2[0];
        libre[1] = libre2[1];
        libre[2] = libre2[2];

        libre2[0] = true;
        libre2[1] = true;
        libre2[2] = true;
      }

    } else {
      for (ll i = 0; i < 3; i++) {
        if (libre[i] == true) {
          pos = i;
          libre[i] = false;
        } else libre[i] = true;
      }
      rot = 1;
    }
  }
}

int get_position() {
	return pos;
}

int get_rotation() {
	return rot;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 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 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!
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Game over! After 5 turns.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 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 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!
9 Incorrect 1 ms 348 KB Game over! After 5 turns.
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Game over! After 3 turns.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 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 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!
9 Incorrect 1 ms 348 KB Game over! After 5 turns.
10 Halted 0 ms 0 KB -