Submission #363958

# Submission time Handle Problem Language Result Execution time Memory
363958 2021-02-07T15:44:46 Z Marlov Mini tetris (IOI16_tetris) C++14
100 / 100
3 ms 384 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 rot;
}

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=3;
			loc=0;
			state=7;
		}else if(state==4){
			rot=0;
			loc=0;
			state=1;
		}else if(state==5){
			rot=3;
			loc=2;
			state=4;
		}else if(state==6){
			rot=3;
			loc=0;
			state=2;
		}else if(state==7){
			rot=0;
			loc=1;
			state=5;
		}else if(state==8){
			rot=3;
			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 0 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 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 0 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 Correct 0 ms 364 KB Win!
10 Correct 1 ms 364 KB Win!
11 Correct 1 ms 364 KB Win!
12 Correct 1 ms 364 KB Win!
13 Correct 1 ms 364 KB Win!
14 Correct 1 ms 364 KB Win!
15 Correct 2 ms 364 KB Win!
16 Correct 3 ms 364 KB Win!
17 Correct 1 ms 364 KB Win!
18 Correct 1 ms 364 KB Win!
19 Correct 1 ms 364 KB Win!
20 Correct 1 ms 364 KB Win!
21 Correct 1 ms 364 KB Win!
22 Correct 1 ms 364 KB Win!
23 Correct 2 ms 364 KB Win!
24 Correct 3 ms 364 KB Win!
25 Correct 3 ms 364 KB Win!
26 Correct 3 ms 364 KB Win!
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Win!
2 Correct 0 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 384 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 0 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 Correct 0 ms 364 KB Win!
10 Correct 1 ms 364 KB Win!
11 Correct 1 ms 364 KB Win!
12 Correct 1 ms 364 KB Win!
13 Correct 1 ms 364 KB Win!
14 Correct 1 ms 364 KB Win!
15 Correct 2 ms 364 KB Win!
16 Correct 3 ms 364 KB Win!
17 Correct 1 ms 364 KB Win!
18 Correct 1 ms 364 KB Win!
19 Correct 1 ms 364 KB Win!
20 Correct 1 ms 364 KB Win!
21 Correct 1 ms 364 KB Win!
22 Correct 1 ms 364 KB Win!
23 Correct 2 ms 364 KB Win!
24 Correct 3 ms 364 KB Win!
25 Correct 3 ms 364 KB Win!
26 Correct 3 ms 364 KB Win!
27 Correct 0 ms 364 KB Win!
28 Correct 0 ms 364 KB Win!
29 Correct 1 ms 364 KB Win!
30 Correct 1 ms 364 KB Win!
31 Correct 1 ms 364 KB Win!
32 Correct 1 ms 384 KB Win!
33 Correct 2 ms 364 KB Win!
34 Correct 3 ms 364 KB Win!
35 Correct 1 ms 364 KB Win!
36 Correct 1 ms 364 KB Win!
37 Correct 1 ms 364 KB Win!
38 Correct 1 ms 364 KB Win!
39 Correct 1 ms 364 KB Win!
40 Correct 1 ms 364 KB Win!
41 Correct 2 ms 364 KB Win!
42 Correct 3 ms 364 KB Win!
43 Correct 3 ms 364 KB Win!
44 Correct 3 ms 364 KB Win!
45 Correct 3 ms 364 KB Win!