| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1005982 | makanhulia | Collecting Mushrooms (NOI18_collectmushrooms) | C++17 | 26 ms | 36048 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int r, c, d, s, jum;
vector<pair<int, int>> v;
signed main() {
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin >> r >> c >> d >> s;
char arr[r + 5][c + 5];
int pref[r + 5][c + 5];
for(int i = 1; i <= r; i++) {
for(int j = 1; j <= c; j++) {
cin >> arr[i][j];
if(arr[i][j] == 'M') {
v.push_back({i, j});
}
}
}
for(int i = 1; i <= r; i++) {
for(int j = 1; j <= c; j++) {
if(arr[i][j] == 'S') {
pref[i][j] = pref[i][j - 1] + pref[i - 1][j] - pref[i - 1][j - 1] + 1;
} else {
pref[i][j] = pref[i][j - 1] + pref[i - 1][j] - pref[i - 1][j - 1];
}
}
}
for(int i = 0; i < v.size(); i++) {
int a = v[i].first, b = v[i].second;
int lr, lc, hr, hc;
lr = max(0ll, a - d - 1);
lc = max(0ll, b - d - 1);
hr = min(r, a + d);
hc = min(c, b + d);
int funi = pref[hr][hc] - pref[lr][hc] - pref[hr][lc] + pref[lr][lc];
if(funi >= s) {
jum++;
}
}
cout << jum << "\n";
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
