# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
929067 | sondos225 | Tetris (COCI17_tetris) | C++17 | 1 ms | 604 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>
using namespace std;
#define int long long
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define yes "YES"
#define no "NO"
#define bigg INT_MAX
#define debug(x) cout<<(#x)<<" = " <<x<<endl;
#define all(x) x.begin(),x.end()
#define sz size()
#define nn '\n'
#define mms(x,y) memset(x,y,sizeof(x))
#define forr(i,j,n) for (int i=j; i<n; i++)
#define forn(i,j,n) for (int i=j; i>n; i--)
#define fi first
#define se second
#define la "LA"
#define cinn(x,y) for(int i=0; i<y; i++) cin>>x[i];
#define pii pair<int,int>
signed main()
{
// #ifndef LOCAL
// freopen("helpcross.in","r",stdin);
// freopen("helpcross.out","w", stdout);
// #endif
fast
int n,m;
cin>>n >>m;
int d[6]={ };
string a[n];
forr(i,0,n) cin>>a[i];
forr(i,0,n-1)
{
forr(j,0,m-1)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i][j+1] && a[i][j]==a[i+1][j+1]) d[1]++;
}
}
forr(i,0,n)
{
forr(j,0,m-3)
{
if (a[i][j]!='.' && a[i][j]==a[i][j+1] && a[i][j]==a[i][j+2] && a[i][j]==a[i][j+3]) d[2]++;
}
}
forr(i,0,n-3)
{
forr(j,0,m)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i+2][j] && a[i][j]==a[i+3][j]) d[2]++;
}
}
forr(i,1,n)
{
forr(j,0,m-2)
{
if (a[i][j]!='.' && a[i][j]==a[i][j+1] && a[i][j]==a[i][j+2] && a[i][j]==a[i-1][j+1]) d[5]++;
}
}
forr(i,0,n-1)
{
forr(j,0,m-2)
{ if (a[i][j]!='.' && a[i][j]==a[i][j+1] && a[i][j]==a[i][j+2] && a[i][j]==a[i+1][j+1]) d[5]++;
}
}
forr(i,0,n-2)
{
forr(j,1,m)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i+2][j] && a[i+1][j-1]==a[i][j]) d[5]++;
}
}
forr(i,0,n-2)
{
forr(j,0,m-1)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i+2][j] && a[i+1][j+1]==a[i][j]) d[5]++;
}
}
forr(i,1,n)
{
forr(j,0,m-2)
{
if (a[i][j]!='.' && a[i][j]==a[i][j+1] && a[i][j]==a[i-1][j+2] && a[i][j]==a[i-1][j+1]) d[3]++;
}
}
forr(i,0,n-2)
{
forr(j,0,m-1)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i+1][j+1] && a[i][j]==a[i+2][j+1]) d[3]++;
}
}
forr(i,0,n-1)
{
forr(j,0,m-2)
{
if (a[i][j]!='.' && a[i][j]==a[i][j+1] && a[i][j]==a[i+1][j+2] && a[i][j]==a[i+1][j+1]) d[4]++;
}
}
forr(i,0,n-2)
{
forr(j,1,m)
{
if (a[i][j]!='.' && a[i][j]==a[i+1][j] && a[i][j]==a[i+1][j-1] && a[i][j]==a[i+2][j-1]) d[4]++;
}
}
cout<<d[1]<<nn<<d[2]<<nn<<d[3]<<nn<<d[4]<<nn<<d[5]<<nn;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |