| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 733789 | vjudge1 | Collecting Mushrooms (NOI18_collectmushrooms) | C++17 | 2086 ms | 4692 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector <pair<ll,ll>> v;
ll r, c, d, k;
bool check(ll a, ll b) {
if(a < r && b < c && a >= 0 && b >= 0) return 1;
else return 0;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> r >> c;
cin >> d >> k;
ll b[r][c];
for(ll i = 0; i < r; i++) {
for(ll j = 0; j < c; j++) {
b[i][j] = 0;
}
}
char ch[r][c];
for(ll i = 0; i < r; i++) {
for(ll j = 0; j < c; j++) {
cin >> ch[i][j];
if(ch[i][j] == 'M') {
v.push_back({i, j});
}
else if(ch[i][j] == 'S') {
for(ll q = i - d; q <= i + d; q++) {
for(ll w = j - d; w <= j + d; w++) {
if(check(q, w) == 0) continue;
b[q][w]++;
}
}
}
}
}
ll ans = 0;
for(ll i = 0; i < v.size(); i++) {
ll f = v[i].first;
ll s = v[i].second;
if(b[f][s] >= k) ans++;
}
cout << ans;
}
컴파일 시 표준 에러 (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... | ||||
