| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 331278 | Vladth11 | Mini tetris (IOI16_tetris) | C++14 | 4 ms | 384 KiB | 
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 <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debug_with_space(x) cerr << #x << " " << x << " "
#include "tetris.h"
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
typedef pair <ll, pii> piii;
const ll NMAX = 200001;
const ll INF = (1 << 30);
const ll MOD = 1000000007;
const ll BLOCK = 101;
const ll nr_of_bits = 20;
const ll delta = 0.0000001;
string s, last;
int n;
int x;
void init(int _n){
    s = "000";
    last = "000";
    n = _n;
}
void new_figure(int fig){
    x = fig;
}
int get_position(){
    last = s;
    if(x == 1){
        return 0;
    }
    if(s == "000" && x == 2){
        s = "110";
        return 0;
    }
    if(s == "000" && x == 3){
        s = "210";
        return 0;
    }
    if(s == "110" && x == 2){
        s = "001";
        return 2;
    }
    if(s == "110" && x == 3){
        s = "011";
        return 1;
    }
    if(s == "210" && x == 2){
        s = "101";
        return 2;
    }
    if(s == "210" && x == 3){
        s = "000";
        return 1;
    }
    if(s == "001" && x == 2){
        s = "000";
        return 0;
    }
    if(s == "001" && x == 3){
        s = "100";
        return 0;
    }
    if(s == "011" && x == 2){
        s = "100";
        return 0;
    }
     if(s == "011" && x == 3){
        s = "110";
        return 0;
    }
    if(s == "101" && x == 2){
        s = "301";
        return 0;
    }
     if(s == "101" && x == 3){
        s = "110";
        return 0;
    }
    if(s == "100" && x == 2){
        s = "000";
        return 1;
    }
    if(s == "100" && x == 3){
        s = "001";
        return 1;
    }
    if(s == "301" && x == 2){
        s = "210";
        return 1;
    }
    if(s == "301" && x == 3){
        s = "100";
        return 1;
    }
}
int get_rotation(){
    if(x == 1){
        return 0;
    }
    if(last == "000" && x == 2){
        return 0;
    }
    if(last == "000" && x == 3){
        return 0;
    }
    if(last == "110" && x == 2){
        return 1;
    }
    if(last == "110" && x == 3){
        return 2;
    }
    if(last == "210" && x == 2){
        return 1;
    }
    if(last == "210" && x == 3){
        return 2;
    }
    if(last == "001" && x == 2){
        last = "000";
        return 0;
    }
    if(last == "001" && x == 3){
        return 0;
    }
    if(last == "011" && x == 2){
        return 1;
    }
     if(last == "011" && x == 3){
        return 3;
    }
    if(last == "101" && x == 2){
        return 1;
    }
     if(last == "101" && x == 3){
        return 2;
    }
    if(last == "100" && x == 2){
        return 0;
    }
    if(last == "100" && x == 3){
        return 1;
    }
    if(last == "301" && x == 2){
        return 1;
    }
    if(last == "301" && x == 3){
        return 3;
    }
}
Compilation message (stderr)
| # | 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... | ||||
