# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
510204 | M_sawas_ | Tetris (COCI17_tetris) | C++17 | 1 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;
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];
}
}
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]){
a++;
}
else if(s[i][j]==s[i][j+2]&&s[i][j]==s[i][j+3]){
b++;
}
else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i+1][j-1]){
c++;
}
else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i-1][j]){
c++;
}
else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i+1][j+2]){
d++;
}
else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i-1][j+1]){
d++;
}
else if(s[i][j]==s[i-1][j+1]&&s[i][j]==s[i][j+2]){
e++;
}
else if(s[i][j]==s[i+1][j+1]&&s[i][j]==s[i][j+2]){
e++;
}
else if(s[i][j]==s[i-1][j]&&s[i][j]==s[i+1][j]){
e++;
}
else if(s[i][j]==s[i-1][j+1]&&s[i][j]==s[i+1][j+1]){
e++;
}
}
else if(s[i][j]==s[i+1][j]&&s[i][j]==s[i+2][j]&&s[i][j]==s[i+3][j]){
b++;
}
}
}
cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |