Submission #510228

#TimeUsernameProblemLanguageResultExecution timeMemory
510228M_sawas_Tetris (COCI17_tetris)C++17
32 / 80
0 ms204 KiB
#include <bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; ll n,m,a,b,c,d,e,x[11][11]; int main() { cin>>n>>m; char s[n][m]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>s[i][j]; x[i][j]=s[i][j]; x[i][j]-=96; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(s[i][j]==s[i][j+1]){ if(s[i][j]==s[i+1][j]&&s[i][j]==s[i+1][j+1]&&s[i][j]!='.'){ a++; } else if(s[i][j]==s[i][j+2]&&s[i][j]==s[i][j+3]&&s[i][j]!='.'){ b++; } else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i+1][j-1]&&s[i][j]!='.'){ c++; } else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i-1][j]&&s[i][j]!='.'){ c++; } else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i+1][j+2]&&s[i][j]!='.'){ d++; } else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i-1][j+1]&&s[i][j]!='.'){ d++; } else if(s[i][j]==s[i-1][j+1]&&s[i][j]==s[i][j+2]&&s[i][j]!='.'){ e++; } else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i][j+2]&&s[i][j]!='.'){ e++; } else if(s[i][j]==s[i-1][j]&&s[i][j]==s[i+1][j]&&s[i][j]!='.'){ e++; } else if(s[i][j]==s[i-1][j+1]&&s[i][j]==s[i+1][j+1]&&s[i][j]!='.'){ e++; } } else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i+2][j]&&s[i][j]==s[i+3][j]&&s[i][j]!='.'){ b++; } } } cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...