# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111332 | vjudge1 | Tetris (COCI17_tetris) | C++17 | 1 ms | 336 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;
const int N = 505;
int n, m;
char a[N][N];
int b[2];
int main() {
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 + 1 < m &&
a[i + 1][j] == a[i][j] &&
a[i][j + 1] == a[i][j] &&
a[i + 1][j + 1] == a[i][j]) {
++b[0];
}
if (j + 3 < m &&
a[i][j + 1] == a[i][j] &&
a[i][j + 2] == a[i][j] &&
a[i][j + 3] == a[i][j]) {
++b[1];
}
if (i + 3 < n &&
a[i + 1][j] == a[i][j] &&
a[i + 2][j] == a[i][j] &&
a[i + 3][j] == a[i][j]) {
++b[1];
}
}
}
cout << b[0] << " " << b[1] << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |