# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
510273 | Toqa44 | Tetris (COCI17_tetris) | C++17 | 1 ms | 316 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 endl "\n"
using namespace std ;
typedef long long ll;
typedef long double ld ;
int n,m,z,c,t,k,l;
char a[13][15];
map<ll,ll>mp;
vector<ll>v;
set<ll>ss;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>m;
for(int g=0;g<n;g++)
{
for(int r=0;r<m;r++)
cin>>a[g][r];
}
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(a[i][j]=='.')
continue;
else
{
if(a[i][j]==a[i][j+1]&&a[i][j]==a[i+1][j]&&a[i][j]==a[i+1][j+1])
{
z++;
a[i][j]='.';
a[i][j+1]='.';
a[i+1][j]='.';
a[i+1][j+1]='.';
}
else if(a[i][j]==a[i][j+1]==a[i][j+2]==a[i][j+3])
{
c++;
a[i][j]='.';
a[i][j+1]='.';
a[i][j+2]='.';
a[i][j+3]='.';
}
else if(a[i][j]==a[i+1][j]==a[i+2][j]==a[i+3][j])
{
c++;
a[i][j]='.';
a[i+1][j]='.';
a[i+2][j]='.';
a[i+3][j]='.';
}
}
}
}
cout<<z<<endl<<c<<endl<<t<<endl<<k<<endl<<l<<endl;
return 0 ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |