QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21264. 소 달리기

Statistics

John과 Bessie 운동 게임. 같은 위치에서 원형 길 $M$($2\le M\le1,000,000,000$), $N$라운드($1\le N\le14$), $8N$카드 $X_i$($0\le X_i<M$).

각 위 $8$ 따로, FJ 위 $4$나 아래 $4$, Bessie 거기서 위 $2$나 아래 $2$. FJ 위 카드 $X_{top}$을 불러 $R*X_{top}$ 달림, $R$ 지금까지 총거리. Bessie 아래 $X_{bottom}$ 불러 $X_{bottom}$ 달립니다.

피곤해서 먼 끝에서 못 돌아올까 우려. 시작부터 $K$($0\le K\le\lfloor M/2\rfloor$) 초과면 못 옵니다.

FJ 바르게 하면 Bessie 무관 귀가 보장. 매번 이후 모든 선택에도 보장할 절반 구합니다. 그녀는 입력대로 하고 다음. 선택 주어져도 어떤 선택이든 성공할 FJ 행동, 미래 모르는 것처럼 해야 합니다.

입력

  • 1행: 공백 구분 정수 $N,M,K$.
  • 2행: $N$문자, $i$번째 T는 그녀 라운드 $i$ 위 $2$, 아니면 B 아래 $2$.
  • $3..2+N$행: 여덟 정수 위부터 아래 카드.

출력

  • 1행: $N$문자, $i$번째 T FJ 위 $4$, B 아래 $4$. 여러 방법 사전순 첫째, 알파벳 가장 작은 문자열.

예제

입력 1

2 2 0
TT
1 0 0 0 0 0 0 1
0 1 1 1 0 0 1 0

출력 1

TB

참고

정확히 시작점 끝나야 합니다. FJ 사전 선택 모름, 알았다면 매번 아래 절반 가능.

문제 출처: Mark Gordon, 2011

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.