RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00404

Jetpack

Unrated 레이팅 미적용
난이도
1s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 64\) \(MB / 80\) points

Little Mirko got a new mobile phone for his birthday! As all kids nowadays, he quickly

downloaded all of the popular mobile games, including Jetpack Joyride.

In the game, the protagonist Barry is running across a field consisting of 10 rows and \(N\)

columns of squares of equal size. Initially, Barry is located in the center of the square in the

lower left corner. Barry is constantly running to the right at the speed of one square per

second. Additionally, he must avoid obstacles that are in his way.

When Mirko presses the phone screen, Barry turns on his sup\(er-du\)per special jetpack and

starts his ascent at the speed of one square per second (still moving to the right, now

moving diagonally up at an angle of 45°, until he reaches the ceiling, when he will continue

moving to the right until Mirko releases the screen). When Mirko releases the phone screen,

Barry starts falling down at the speed of one square per second (now moving diagonally

again, but this time facing down, until he reaches the floor, when he will continue moving to

the right).

Mirko just started playing the game recently and he’s still not good at it. He saw on YouTube
that someone managed to complete the game by crossing all \(N\)

columns, so he is asking
you for your help. He will give you the layout of the fields in the game, and you must output
the moves he has to play in order to win.

제약
입력 형식

The first line of input contains the integer \(N\)

(1 ≤ \(N\)

≤ 10 {5}{ }), the size of the field.
Each of the following 10 lines contains \(N\)

characters ‘.’ and ‘X’, the layout of the field in the
game. The characters ‘X’ denote obstacles, and ‘.’ walkable fields.

출력 형식

The first line of output must contain the integer \(P\)

(0 ≤ \(P\)

\(5 \cdot 10\) {4}{ }), the number of moves
Mirko has to make.
In the following \(P\)

lines, output any series of \(P\)

moves, each in its own line, such that it solves
Mirko’s problem from the task.
A move is determined by two integers \(t\)

\(i\)

and \(x\)

\(i\)

, where \(t\)

\(i\)

denotes the second in which Mirko
has to press the screen, and \(x\)

{i}{ }^{denotes how long he needs to keep the screen pressed.}

A series of moves must be sorted in chronological order. In other words, it must hold \(t\)

\(i\)

  • \(x\)

\(i\)


\(t\)_{\(i+1\)}.
Also, no move should begin after the end of the game, \(t\)

\(i\)

< \(N\)

.

The input data will be such that a solution will surely exist.

1 \(s / 64\) \(MB / 80\) points

예제 1
입력
11
.....XX...X
....XX...XX
...XX...XX.
...........
....XXX....
...........
.....X.....
....XX...X.
...XX...XX.
...X...XX..
20
X..................X
.X................X.
..X..............X..
...X............X...
....X..........X....
.....X........X.....
......X......X......
.......X....X.......
........X..X........
.........XX.........
출력
output
2
1 4
7 2
1
8 10
설명

Clarification of the first test case:
The path Mirko has to take is denoted with ‘*’:

.....XX...X
....XX...XX
...XX...XX.
...........
....XXX....
.........
....X..
...XX..X.
..XX...XX.
*.X...XX..

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2016/2017 Contest 1

평가 및 의견

Jetpack

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Jetpack

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8