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

18966번 - Alice and Bob (and string): Double Menace 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB4000.000%

문제

From the creators of "Alice and Bob (and string)" and "Alice and Bob (and string) Strikes Back"!

Alice and Bob are playing a game. Initially they have a string $s$ and its substring $t$. Each player's turn consists of adding an arbitrary letter $c_l$ to the left of $t$ and an arbitrary letter $c_r$ to the right of $T$ in such a way that $t$ is still a substring of $s$. The player who can't make a valid move loses.

Alice moves first. Before she makes the first move, she has the right to choose the initial string $t$. Of course, Alice wants to cheat and will choose such a string $t$ that will guarantee her victory (assuming both players act optimally), but she doesn't want Bob to suspect anything. Therefore, Alice decided to choose the $k$-th lexicographically smallest string among all possible winning initial strings $t$. Help Alice!

입력

The first line of input contains string $s$ of lowercase English letters (1ドル \leq |s| \leq 10^5$).

The second line contains integer $k$ (1ドル \leq k \leq 10^{10}$).

출력

If there are less than $k$ suitable options for the string $t,ドル print "no solution". Otherwise, print the $k$-th lexicographically smallest one. If the answer is an empty string, print "-" instead.

제한

예제 입력 1

abac
3

예제 출력 1

b

예제 입력 2

rndstr
1

예제 출력 2

-

예제 입력 3

abc
10

예제 출력 3

no solution

힌트

Winning strings for $s=\mathtt{abac}$ are -, a, b, ba.

출처

Camp > Petrozavodsk Programming Camp > Summer 2018 > Day 3: MIPT Contest A번

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

출처

대학교 대회

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

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