# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44583 | heon | Tetris (COCI17_tetris) | C++11 | 2 ms | 608 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>
using namespace std;
char grid[15][15];
int red,stup;
int rj[5];
void provjeri(int a,int b){
if(grid[a][b] == grid[a+1][b] && grid[a][b] == grid[a+1][b+1] && grid[a][b] == grid[a][b+1]) rj[0]++;
else if(grid[a][b] == grid[a][b+1] && grid[a][b] == grid[a][b+2] && grid[a][b] == grid[a][b+3]) rj[1]++;
else if(grid[a][b] == grid[a][b+1] && grid[a][b] == grid[a-1][b+1] && grid[a][b] == grid[a-1][b+2]) rj[2]++;
else if(grid[a][b] == grid[a][b+1] && grid[a][b] == grid[a+1][b+1] && grid[a][b] == grid[a+1][b+2]) rj[3]++;
else if(grid[a][b] == grid[a+1][b] && grid[a][b] == grid[a+1][b+1] && grid[a][b] == grid[a+1][b-1]) rj[4]++;
}
int main(){
cin >> red >> stup;
for(int i = 0; i < red; i++){
cin >> grid[i];
}
memset(rj,0,sizeof(rj));
for(int i = 0; i < red; i++){
for(int j = 0; j < stup; j++){
if(grid[i][j] == '.') continue;
provjeri(i,j);
}
}
for(int i = 0; i < 5; i++){
cout << rj[i] << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |