| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 163429 | iefnah06 | Dango Maker (JOI18_dango_maker) | C++11 | 319 ms | 18168 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXL = 3010;
int X, Y;
char G[MAXL][MAXL];
int main() {
scanf("%d %d", &X, &Y);
for (int x = 1; x <= X; x++) {
scanf("%s", G[x] + 1);
}
int ans = 0;
for (int xpy = 1; xpy <= X + Y; xpy++) {
array<int, 3> dp = {};
for (int x = 1; x <= X; x++) {
int y = xpy - x;
if (y < 1 || y > Y) continue;
array<int, 3> ndp = {};
// horizontal
if (G[x][y - 1] == 'R' && G[x][y] == 'G' && G[x][y + 1] == 'W') {
ndp[0] = 1 + max(dp[0], dp[2]);
}
// vertical
if (G[x - 1][y] == 'R' && G[x][y] == 'G' && G[x + 1][y] == 'W') {
ndp[1] = 1 + max(dp[1], dp[2]);
}
// do nothing
ndp[2] = *max_element(dp.begin(), dp.end());
swap(dp, ndp);
}
ans += *max_element(dp.begin(), dp.end());
}
printf("%d\n", ans);
return 0;
}
컴파일 시 표준 에러 (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... | ||||
