# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
139246 | mihnea_anghel | Tetris (COCI17_tetris) | C++17 | 2 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
struct figura{
int n, m, a[4][4];
};
struct tip {
int numar;
figura fig[4];
};
tip f[5] ={
{ // prima figura
1, //o asezare posibila
{
{ 2, 2, // n si m
{ { 1, 1, 0, 0 },
{ 1, 1, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } }
}
},
{
2,
{
{ 1, 4,
{ { 1, 1, 1, 1 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 4, 1,
{ { 1, 0, 0, 0 },
{ 1, 0, 0, 0 },
{ 1, 0, 0, 0 },
{ 1, 0, 0, 0 } } }
}
},
{
2,
{
{ 2, 3,
{ { 0, 1, 1, 0 },
{ 1, 1, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 3, 2,
{ { 1, 0, 0, 0 },
{ 1, 1, 0, 0 },
{ 0, 1, 0, 0 },
{ 0, 0, 0, 0 } } }
}
},
{
2,
{
{ 2, 3,
{ { 1, 1, 0, 0 },
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 3, 2,
{ { 0, 1, 0, 0 },
{ 1, 1, 0, 0 },
{ 1, 0, 0, 0 },
{ 0, 0, 0, 0 } } }
}
},
{
4,
{
{ 2, 3,
{ { 0, 1, 0, 0 },
{ 1, 1, 1, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 2, 3,
{ { 1, 1, 1, 0 },
{ 0, 1, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 3, 2,
{ { 0, 1, 0, 0 },
{ 1, 1, 0, 0 },
{ 0, 1, 0, 0 },
{ 0, 0, 0, 0 } } },
{ 3, 2,
{ { 1, 0, 0, 0 },
{ 1, 1, 0, 0 },
{ 1, 0, 0, 0 },
{ 0, 0, 0, 0 } } },
}
}
};
int sol[5], n, m, j, i, t, r, ok;
char a[10][10];
int main() {
cin>>n>>m;
for ( i=0; i < n; i++ ) for ( j=0; j < m; j++ ) cin >> a[i][j];
for ( t=0; t <= 4; t++ )
for ( r=0; r < f[t].numar; r++ ){
int lin = f[t].fig[r].n;
int col = f[t].fig[r].m;
for ( int ic=0; ic+lin-1 < n; ic++ ) // setez coltul din stanga sus
for ( int jc=0; jc+col-1 < m; jc++ )
for ( int litera='a'; litera <= 'z'; litera++ ){//setez litera figurii vrute
ok = 1;
for ( i=0; i < lin; i++ )
for ( j=0; j < col; j++ ){
if ( f[t].fig[r].a[i][j] == 1 && a[ic+i][jc+j] != litera ) ok=0;
if ( f[t].fig[r].a[i][j] == 0 && a[ic+i][jc+j] == litera ) ok=0;
}
sol[t] += ok;
}
}
for ( i=0; i < 5; i++ ) cout<<sol[i]<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |