Submission #44583

#TimeUsernameProblemLanguageResultExecution timeMemory
44583heonTetris (COCI17_tetris)C++11
16 / 80
2 ms608 KiB
#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 timeMemoryGrader output
Fetching results...