# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947219 | devkudawla | Bitaro the Brave (JOI19_ho_t1) | C++17 | 355 ms | 89496 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;
void solve(bool testCases = true) {
int T = 1;
if (testCases) cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
vector<string> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
int r[n][m] = {0};
memset(r, 0, sizeof(r));
for (int i = 0; i < n; i++) {
for (int j = m - 2; j >= 0; j--) {
r[i][j] += r[i][j + 1];
if (v[i][j + 1] == 'O') {
r[i][j]++;
}
}
}
int c[n][m] = {0};
memset(c, 0, sizeof(c));
for (int j = 0; j < m; j++) {
for (int i = n - 2; i >= 0; i--) {
c[i][j] += c[i + 1][j];
if (v[i + 1][j] == 'I') {
c[i][j]++;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |