# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
52162 | WLZ | Dango Maker (JOI18_dango_maker) | C++17 | 831 ms | 111716 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;
int h, w;
vector<string> s;
int solve(int y, int x) {
vector<int> v;
for (int k = 0; y - k >= 0 && x + k < w; k++) {
int i = y - k;
int j = x + k;
if (s[i][j] != 'G') {
v.push_back(0);
continue;
}
int a = 0;
if (j > 0 && j + 1 < w && s[i][j - 1] == 'R' && s[i][j + 1] == 'W') {
a++;
}
if (i > 0 && i + 1 < h && s[i - 1][j] == 'R' && s[i + 1][j] == 'W') {
a += 2;
}
v.push_back(a);
}
vector<vector<int>> dp((int) v.size() + 1, vector<int>(2, 0));
for (int i = 0; i < (int) v.size(); i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |