Submission #363953

# Submission time Handle Problem Language Result Execution time Memory
363953 2021-02-07T15:38:06 Z Marlov Mini tetris (IOI16_tetris) C++14
28 / 100
3 ms 364 KB
/*
Code by @marlov       
*/
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <utility>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <iterator>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;

int type;
int rot=0;
int loc=0;
int state=1;
/*
1: ---
2: *--
3: -*-
4: --*
5: **-
6: -**

   *__
7: **_

   **_
8: **-
*/

int get_position(){
	return loc;
}

int get_rotation(){
	return loc;
}

void new_figure(int figure_type){
	int x=figure_type;
	if(x==1){
		type=1;
		rot=0;
		loc=0;
	}else if(x==2){
		if(state==1){
			rot=0;
			loc=0;
			state=5;
		}else if(state==2){
			rot=0;
			loc=1;
			state=1;
		}else if(state==3){
			rot=1;
			loc=0;
			state=5;
		}else if(state==4){
			rot=0;
			loc=0;
			state=1;
		}else if(state==5){
			rot=1;
			loc=2;
			state=4;
		}else if(state==6){
			rot=1;
			loc=0;
			state=2;
		}else if(state==7){
			rot=0;
			loc=1;
			state=5;
		}else if(state==8){
			rot=1;
			loc=2;
			state=1;
		}
	}else if(x==3){
		if(state==1){
			rot=0;
			loc=0;
			state=7;
		}else if(state==2){
			rot=1;
			loc=1;
			state=4;
		}else if(state==3){
			rot=3;
			loc=0;
			state=8;
		}else if(state==4){
			rot=0;
			loc=0;
			state=2;
		}else if(state==5){
			rot=2;
			loc=1;
			state=6;
		}else if(state==6){
			rot=3;
			loc=0;
			state=5;
		}else if(state==7){
			rot=2;
			loc=1;
			state=1;
		}else if(state==8){
			rot=2;
			loc=1;
			state=3;
		}
	}
}

void init(int n){
	return;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Win!
2 Correct 1 ms 364 KB Win!
3 Correct 1 ms 364 KB Win!
4 Correct 1 ms 364 KB Win!
5 Correct 1 ms 364 KB Win!
6 Correct 1 ms 364 KB Win!
7 Correct 2 ms 364 KB Win!
8 Correct 3 ms 364 KB Win!
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Bad position for figure 2 : 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Win!
2 Correct 1 ms 364 KB Win!
3 Correct 1 ms 364 KB Win!
4 Correct 1 ms 364 KB Win!
5 Correct 1 ms 364 KB Win!
6 Correct 1 ms 364 KB Win!
7 Correct 2 ms 364 KB Win!
8 Correct 3 ms 364 KB Win!
9 Incorrect 1 ms 364 KB Bad position for figure 2 : 2
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Win!
2 Correct 1 ms 364 KB Win!
3 Correct 1 ms 364 KB Win!
4 Correct 1 ms 364 KB Win!
5 Correct 1 ms 364 KB Win!
6 Correct 1 ms 364 KB Win!
7 Correct 2 ms 364 KB Win!
8 Correct 3 ms 364 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Win!
2 Correct 1 ms 364 KB Win!
3 Correct 1 ms 364 KB Win!
4 Correct 1 ms 364 KB Win!
5 Correct 1 ms 364 KB Win!
6 Correct 1 ms 364 KB Win!
7 Correct 2 ms 364 KB Win!
8 Correct 3 ms 364 KB Win!
9 Incorrect 1 ms 364 KB Bad position for figure 2 : 2
10 Halted 0 ms 0 KB -