AT_abc458_a.Chompers
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a string S consisting of lowercase English letters and a positive integer N. The length of S is at least 2N+1.
Find the string obtained by removing N characters from the beginning and N characters from the end of S.
给定一个由小写英文字母组成的字符串 S 和一个正整数 N。字符串 S 的长度至少为 2N+1。
求从 S 的开头删除 N 个字符、并从结尾删除 N 个字符后所得到的字符串。
输入格式
The input is given from Standard Input in the following format:
S
N
输入从标准输入中按以下格式给出:
S
N
输出格式
Output the answer.
输出答案。
输入输出样例
输入#1
chemotherapy 3
输出#1
mother
输入#2
thermometer 4
输出#2
mom
输入#3
burger 1
输出#3
urge
说明/提示
Sample 1 Explanation:
Removing the first three characters (che) and the last three characters (apy) from chemotherapy gives mother.
Constraints
- S is a string consisting of lowercase English letters.
- N is an integer.
- 2N+1≤∣S∣≤30
- 1≤N≤10
样例 1 解释:
从字符串 chemotherapy 中删除前三个字符(che)和后三个字符(apy),得到 mother。
约束条件
- S 是一个仅由小写英文字母组成的字符串。
- N 是一个整数。
- 2N+1≤∣S∣≤30
- 1≤N≤10
输入解题思路,AI测评打分。不知道怎么写?