# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
335356 | ncduy0303 | Collecting Mushrooms (NOI18_collectmushrooms) | C++17 | 22 ms | 5248 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;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
void solve() {
int r, c, d, k; cin >> r >> c >> d >> k;
int ps[r + 1][c + 1] = {};
char grid[r + 1][c + 1];
for (int i = 1; i <= r; i++) {
for (int j = 1; j <= c; j++) {
cin >> grid[i][j];
ps[i][j] = (grid[i][j] == 'S') + ps[i - 1][j] + ps[i][j - 1] - ps[i - 1][j - 1];
}
}
int ans = 0;
for (int i = 1; i <= r; i++) {
for (int j = 1; j <= c; j++) {
if (grid[i][j] == 'M') {
int tli = max(1, i - d), tlj = max(1, j - d);
int bri = min(r, i + d), brj = min(c, j + d);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |