포럼
문제 ICPC00224

E. Evolving Etymology

설명

Eelco has recently started to gain interest in the field that studies the origin of words: etymology. He especially likes how words can evolve in many different ways: pronunciation changes over time, words are borrowed from different languages, and the meaning of words can change based on culture. Eelco is eager to attend the Networking With Etymologists: Revolutionary Conference for the first time ever. To make a good first impression, he is going to present a completely new method to make new words from existing words.

To make a new word from an existing word \(s\), Eelco proposes to take every second letter of \(s+s\), starting with the first letter. For example, applying this method to the word "etymology" would result in "eyooytmlg". Of course, to design even more words, this process can be repeated many times. Eelco would like to prepare a list of new words to present at the conference, so he writes a program that applies his method some predetermined number of times.

제약
입력 형식

The input consists of:
- One line with two integers \(n\) and \(k\) (\(1 \leq n \leq 10^5\), \(1 \leq k \leq 10^{18}\)), the length of the original word and the number of times to apply the method.
- One line with a string \(s\) of length \(n\), only consisting of English lowercase letters (a-z), the original word.

출력 형식

Output the resulting word after applying the method to the original word \(k\) times.

예제 1
입력
9 1
etymology
출력
eyooytmlg
예제 2
입력
4 1
word
출력
wrwr
예제 3
입력
5 1000000000000000000
delft
출력
delft
예제 4
입력
5 5
eceol
출력
eelco
문제 정보

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

출처 ICPC NWERC 2024

평가 및 의견

E. Evolving Etymology

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

Log in to rate problems.

개별 의견

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

풀이 제출

E. Evolving Etymology

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