Logo
(追記) (追記ここまで)

32487번 - Kitten of Chaos 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB1551167373.737%

문제

Karen has a beautiful precious glass object on the shelf in her living room. Unfortunately, her cat Klaus does not like it when there is stuff on his favourite shelf. Everything that is not bolted or glued in place, he will gradually push over the edge while looking Karen straight in the eyes.

Now, Klaus' paw slowly executes his diabolical deed. His cute fluffy face radiates inadvertent innocence. Knowing that any intervention would only delay the inevitable, Karen wonders what will happen to the string her sister Kim wrote on the precious glass object. After all, it took Kim a whole week to gather all the bdpq letters that make up the string.

Can you describe to Karen what the string will look like from her point of view while it tumbles towards destruction?

While falling off the shelf, Karen's precious glass object is subject to the following transformations, described as seen when looking at the object from the front.

  • h: horizontal flip, e.g. bbq becomes pdd
  • v: vertical flip, e.g. bbq becomes ppd
  • r: 180-degree rotation, e.g. bbq becomes bqq

No flips along or rotations about any other axes are possible.

입력

The input consists of:

  • One line with a string $s$ consisting of the letters bdpq (1ドル \le |s| \le 5\cdot 10^5$), the string printed on the glass object as seen at the start of the fall.
  • One line with a string $t$ consisting of the letters hvr (1ドル \le |t| \le 5\cdot 10^5$) giving the sequence of transformations in the order that they occur during the fall.

출력

Output the string that can be seen at the moment the glass object touches the ground and just before it shatters into pieces.

제한

예제 입력 1

bbq
h

예제 출력 1

pdd

예제 입력 2

bbq
v

예제 출력 2

ppd

예제 입력 3

bbq
r

예제 출력 3

bqq

예제 입력 4

ppbddbq
hvrhv

예제 출력 4

bqppqdd

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2024 K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /