Submission #1111333

# Submission time Handle Problem Language Result Execution time Memory
1111333 2024-11-12T06:07:44 Z vjudge1 Tetris (COCI17_tetris) C++17
0 / 80
1 ms 336 KB
#include <iostream>
using namespace std;

const int N = 505;
int n, m;
char a[N][N];
int b[2];

int main(void) {
  cin >> n >> m;

  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (a[i][j] == '.') continue;

      if (i + 1 < n && j > 0 && j + 1 < m &&
          a[i + 1][j - 1] == a[i][j] &&
          a[i + 1][j] == a[i][j] &&
          a[i][j + 1] == a[i][j]) {
        ++b[0];
      }
      if (i + 2 < n && j + 1 < m &&
          a[i + 1][j] == a[i][j] &&
          a[i + 1][j + 1] == a[i][j] &&
          a[i + 2][j + 1] == a[i][j]) {
        ++b[0];
      }

      if (i + 1 < n && j + 2 < m &&
          a[i][j + 1] == a[i][j] &&
          a[i + 1][j + 1] == a[i][j] &&
          a[i + 1][j + 2] == a[i][j]) {
        ++b[1];
      }
      if (i + 2 < n && j > 0 &&
          a[i + 1][j - 1] == a[i][j] &&
          a[i + 1][j] == a[i][j] &&
          a[i + 2][j - 1] == a[i][j]) {
        ++b[1];
      }
    }
  }

  cout << b[0] << " " << b[1] << endl;
  return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 1 ms 336 KB Output isn't correct
4 Incorrect 1 ms 336 KB Output isn't correct
5 Incorrect 1 ms 336 KB Output isn't correct
6 Incorrect 1 ms 336 KB Output isn't correct
7 Incorrect 1 ms 336 KB Output isn't correct
8 Incorrect 1 ms 336 KB Output isn't correct
9 Incorrect 1 ms 336 KB Output isn't correct
10 Incorrect 1 ms 336 KB Output isn't correct