# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
469964 | rainboy | Tetris (COCI17_tetris) | C11 | 1 ms | 272 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 10
#define M 10
int dij[][3][2] = {
{ { 0, 1 }, { 1, 0 }, { 1, 1 } },
{ { 0, 1 }, { 0, 2 }, { 0, 3 } },
{ { 0, 1 }, { 1, 0 }, { 1, -1 } },
{ { 0, -1 }, { 1, 0 }, { 1, 1 } },
{ { -1, 0 }, { 0, -1 }, { 0, 1 } },
};
int rr[] = { 1, 2, 2, 2, 4 };
int main() {
static char cc[N][M + 1];
int n, m, t, r, h, i, j, k;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
scanf("%s", cc[i]);
for (t = 0; t < 5; t++) {
k = 0;
for (r = 0; r < rr[t]; r++)
for (i = 0; i < n; i++)
for (j = 0; j < m; j++) {
int good;
if (cc[i][j] == '.')
continue;
good = 1;
for (h = 0; h < 3; h++) {
int i_, j_;
if (r == 0)
i_ = i + dij[t][h][0], j_ = j + dij[t][h][1];
else if (r == 1)
i_ = i - dij[t][h][1], j_ = j + dij[t][h][0];
else if (r == 2)
i_ = i - dij[t][h][0], j_ = j - dij[t][h][1];
else
i_ = i + dij[t][h][1], j_ = j - dij[t][h][0];
if (i_ < 0 || i_ >= n || j_ < 0 || j_ >= m || cc[i_][j_] != cc[i][j]) {
good = 0;
break;
}
}
if (good)
k++;
}
printf("%d\n", k);
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |