# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
510228 | M_sawas_ | Tetris (COCI17_tetris) | C++17 | 0 ms | 204 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>
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |