A13358 | Au Pont Rouge
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string $s$ written on its side. This part of the office is supposed to be split into $m$ 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 $s$ written on its side.
For each possible arrangement of $m$ 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 $k$ th label of the delivery?
For each possible arrangement of $m$ 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 $k$ th label of the delivery?
输入格式
In the first line, you are given three integer numbers $n, m, k$ — length of string $s$ , number of planned meeting rooms to split $s$ into and number of the interesting label ( $2 \le n \le 1\,000; 1 \le m \le 1\,000; 1 \le k \le 10^{18}$ ).
Second input line has string $s$ , consisting of $n$ lowercase english letters.
For given $n, m, k$ there are at least $k$ ways to split $s$ into $m$ substrings.
Second input line has string $s$ , consisting of $n$ lowercase english letters.
For given $n, m, k$ there are at least $k$ ways to split $s$ into $m$ substrings.
输出格式
Output single string – name of meeting room printed on $k$ -th label of the delivery.
输入输出样例
输入 #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 $3060$ labels. The first label is "aupontrougevkof" and the last one is "a".
In the second example, delivery consists of $3060$ labels. The first label is "aupontrougevkof" and the last one is "a".
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted