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

16548번 - Unique Substrings 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB115480.000%

문제

Create a string of N lowercase letters S1S2 . . . SN where 1 ≤ N ≤ 212. The string should have exactly K unique substrings.

A substring is the sequence of letters of the form SLSL+1 . . . SR−1SR for some 1 ≤ L ≤ R ≤ N. Two substrings are the same if they are the same sequence of letters.

입력

Line 1 contains one integer K (1 ≤ K ≤ 222). N is not given; the string that you create may have any number of letters N as long as 1 ≤ N ≤ 212.

출력

Print one line with one string of N lowercase letters where 1 ≤ N ≤ 212. It should have exactly K unique substrings. If there are multiple such strings, any will be accepted. It can be proven that such a string always exists with the given constraints of N and K.

제한

예제 입력 1

15

예제 출력 1

banana

예제 입력 2

351

예제 출력 2

abcdefghijklmnopqrstuvwxyz

힌트

For the first example, the 15 unique substrings of banana are a, an, ana, anan, anana, b, ba, ban, bana, banan, banana, n, na, nan and nana. Another string that has 15 unique substrings is aaaaaaaaaaaaaaa which would also be a correct output for the first example.

출처

Contest > Waterloo's local Programming Contests > 30 September, 2018 C번

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

출처

대학교 대회

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

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