| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 201087 | SamAnd | Jetpack (COCI16_jetpack) | C++17 | 25 ms | 7920 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
const int N = 100005;
int m;
char a[12][N];
bool c[12][N];
int p[12][N];
int main()
{
scanf("%d", &m);
for (int i = 0; i < 10; ++i)
{
scanf(" %s", a[i]);
}
c[9][0] = true;
for (int j = 0; j < m - 1; ++j)
{
for (int i = 0; i < 10; ++i)
{
if (!c[i][j])
continue;
if (i == 9)
{
if (a[i][j + 1] == '.')
{
c[i][j + 1] = true;
p[i][j + 1] = i;
}
}
if (i == 0)
{
if (a[i][j + 1] == '.')
{
c[i][j + 1] = true;
p[i][j + 1] = i;
}
}
if (i + 1 < 10)
{
if (a[i + 1][j + 1] == '.')
{
c[i + 1][j + 1] = true;
p[i + 1][j + 1] = i;
}
}
if (i - 1 >= 0)
{
if (a[i - 1][j + 1] == '.')
{
c[i - 1][j + 1] = true;
p[i - 1][j + 1] = i;
}
}
}
}
vector<pair<int, int> > ans;
int j = m - 1;
for (int i = 0; i < 10; ++i)
{
if (c[i][j])
{
while (1)
{
if (j == 0)
break;
if (p[i][j] > i || (p[i][j] == i && i == 0))
{
ans.push_back(m_p(j - 1, 1));
}
i = p[i][j];
--j;
}
break;
}
}
reverse(ans.begin(), ans.end());
printf("%d\n", ans.size());
for (int i = 0; i < ans.size(); ++i)
{
printf("%d %d\n", ans[i].first, ans[i].second);
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
