# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752317 | gnu | Dijamant (COCI22_dijamant) | C++14 | 226 ms | 104896 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 <iostream>
#include <vector>
using namespace std;
vector<vector<long long>> pref;
long long get(int i, int l, int r)
{
return pref[i][r+1] - pref[i][l];
}
int main()
{
int n, m; cin >> n >> m;
vector<string> mat(n);
for (auto& x : mat) cin >> x;
vector<vector<int>> a, b, c, d;
a = b = c = d = vector<vector<int>>(n, vector<int>(m, -1));
pref = vector<vector<long long>>(n, vector<long long>(m + 1));
for (int i = 0; i < n; ++i) {
for (int j = 1; j <= m; ++j) {
pref[i][j] = pref[i][j - 1] + (mat[i][j - 1] == '#');
}
}
//cout << get(2, 1, 6) << '\n';
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
if (i > 0 && j + 2 < m) {
if (mat[i][j] == '#' && mat[i][j + 1] == '.' && mat[i][j + 2] == '#' && mat[i - 1][j + 1] == '#') a[i][j] = 1, b[i][j + 2] = 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |