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

Digitalna

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Bronze I 브론즈 I
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

A while ago, Mirko's grandparents had to switch from analog to digital TV receiver. On their old analog receiver they could watch only two channels: BLJTV1 and BLJTV2. Switching to digital receiver they gained dozens of new channels, but they still wanted to watch just the two channels they had before. They asked Mirko to adjust the remote control in a way that BLJTV1 is on first and BLJTV2 on the second key.

When switched on, digital receiver creates a list of available channels. All of the channels are distinct and the list always contains BLJTV1 and BLJTV2. Mirko found the remote and he started adjusting the receiver. Menu contains the channel list and a little arrow which is marking the currently selected channel. After entering the menu, the arrow is marking the first channel on the list.

There are four operations in the menu, denoted with numbers \(1\) to \(4\):

  1. move the arrow one place down (from channel \(i\) to channel \(i+1\))
  2. move the arrow one place up (from channel \(i\) to channel \(i-1\))
  3. move the arrow and selected channel one place down (channel \(i\) and channel \(i+1\) are switching places, arrow ends up in place \(i+1\))
  4. move the arrow and selected channel one place up (channel \(i\) and channel \(i-1\) are switching places, arrow ends up in place \(i-1\))

Menu is robust, so invalid commands (such as a command which would move the arrow outside of the channel list) are just ignored.

Write a program which will, given a channel list, output a sequence of any operations such that, after they are executed, BLJTV1 will be on the first, and BLJTV2 on the second place in channel list. Additionally, the sequence length should be less than \(500\). Ordering of all other channels is arbitrary.

제약
입력 형식

First line of input contains a positive integer \(N\) (\(2 \le N \le 100\)), number of channels.

Next \(N\) lines contain a list of channels generated by the digital receiver. Each line contains the name of one channel. Channel name is a sequence of at most \(10\) characters — capital letters of English alphabet and digits.

Input sequence is created in such way that it will always be required to make at least one operation.

출력 형식

First and only line of output should contain the sequence of Mirko's commands with no spaces in between.

Note: Any valid sequence (of length less than \(500\)) is accepted.

서브태스크
서브태스크점수설명

Test 1

20점

None

Test 2

20점

None

Test 3

20점

None

Test 4

20점

None

Test 5

20점

None

예제 1
입력
3
ABC
BLJTV1
BLJTV2
출력
33
예제 2
입력
4
ABC1
ABC02
BLJTV2
BLJTV1
출력
11144411144
예제 3
입력
4
ABC1
ABC02
BLJTV2
BLJTV1
출력
33144413
문제 정보

riseoj 작성

출처 COCI 2011/2012 Contest 3

평가 및 의견

Digitalna

개요
출제자 난이도 Bronze I 브론즈 I 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Digitalna

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