CF1310C.Au Pont Rouge

省选/NOI-

通过率:0%

时间限制:2.00s

内存限制:512MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string ss written on its side. This part of the office is supposed to be split into mm meeting rooms in such way that meeting room walls are strictly between letters on the building. Obviously, meeting rooms should not be of size 0, but can be as small as one letter wide. Each meeting room will be named after the substring of ss written on its side.

For each possible arrangement of mm meeting rooms we ordered a test meeting room label for the meeting room with lexicographically minimal name. When delivered, those labels got sorted backward lexicographically.

What is printed on kkth label of the delivery?

VK 刚刚在圣彼得堡开设了其第二总部!其办公楼的一侧写有一个超长字符串 ss。该办公楼区域需被划分为 mm 个会议室,划分位置必须严格位于字符串 ss 的字母之间。显然,每个会议室的长度不能为 0,但最小可以仅为一个字母宽。每个会议室将根据其所在位置对应的 ss 的子串来命名。

对于所有可能的将 ss 划分为 mm 个非空连续子串(即 mm 个会议室)的方式,我们分别为每种划分方式订购了一个测试会议室标签——该标签对应于该划分下所有子串中字典序最小的那个子串(即该划分所生成的 mm 个子串中字典序最小者)。这些标签送达后,按字典序逆序(即降序)进行了排序。

请问:送达的标签中第 kk 个标签上印的是什么?

输入格式

In the first line, you are given three integer numbers n,m,kn, m, k — length of string ss, number of planned meeting rooms to split ss into and number of the interesting label (2≤n≤1 000;1≤m≤1 000;1≤k≤10182 \le n \le 1\,000; 1 \le m \le 1\,000; 1 \le k \le 10^{18}).

Second input line has string ss, consisting of nn lowercase english letters.

For given n,m,kn, m, k there are at least kk ways to split ss into mm substrings.

第一行给出三个整数 n,m,kn, m, k —— 字符串 ss 的长度、计划将 ss 分割成的会议室数量,以及感兴趣的标签编号(满足 2≤n≤1 0002 \le n \le 1\,000;1≤m≤1 0001 \le m \le 1\,000;1≤k≤10181 \le k \le 10^{18})。

第二行输入字符串 ss,由 nn 个小写英文字母组成。

对于给定的 n,m,kn, m, k,将 ss 分割为 mm 个子字符串的方式至少有 kk 种。

输出格式

Output single string – name of meeting room printed on kk-th label of the delivery.

输出单个字符串——快递第 kk 个标签上印制的会议室名称。

输入输出样例

  • 输入#1

    4 2 1
    abac

    输出#1

    aba
  • 输入#2

    19 5 1821
    aupontrougevkoffice

    输出#2

    au

说明/提示

In the first example, delivery consists of the labels "aba", "ab", "a".

In the second example, delivery consists of 30603060 labels. The first label is "aupontrougevkof" and the last one is "a".

在第一个例子中,投递的标签依次为“aba”、“ab”、“a”。

在第二个例子中,投递共包含 30603060 个标签。第一个标签是 “aupontrougevkof”,最后一个标签是 “a”。

输入解题思路,AI测评打分。不知道怎么写?

首页