AT_abc458_a.Chompers

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

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

题目描述

You are given a string SS consisting of lowercase English letters and a positive integer NN. The length of SS is at least 2N+12N+1.

Find the string obtained by removing NN characters from the beginning and NN characters from the end of SS.

给定一个由小写英文字母组成的字符串 SS 和一个正整数 NN。字符串 SS 的长度至少为 2N+12N+1。

求从 SS 的开头删除 NN 个字符、并从结尾删除 NN 个字符后所得到的字符串。

输入格式

The input is given from Standard Input in the following format:

SS
NN

输入从标准输入中按以下格式给出:

SS
NN

输出格式

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

  • SS is a string consisting of lowercase English letters.
  • NN is an integer.
  • 2N+1≤∣S∣≤302N+1 \leq |S| \leq 30
  • 1≤N≤101 \leq N \leq 10

样例 1 解释:
从字符串 chemotherapy 中删除前三个字符(che)和后三个字符(apy),得到 mother。

约束条件

  • SS 是一个仅由小写英文字母组成的字符串。
  • NN 是一个整数。
  • 2N+1≤∣S∣≤302N+1 \leq |S| \leq 30
  • 1≤N≤101 \leq N \leq 10

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

首页