AT_abc469_a.Train Car

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

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

题目描述

There is a train consisting of NN cars. What is the position, counted from the back, of the car that is KK-th from the front of this train?

有一列由 NN 节车厢组成的火车。从车尾开始计数,这列火车中从车头开始数第 KK 节车厢的位置是多少?

输入格式

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

NN KK

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

NN KK

输出格式

If the car is XX-th from the back, output the integer XX in one line.

如果该车从后往前数是第 XX 辆,则在一行中输出整数 XX。

输入输出样例

  • 输入#1

    5 2

    输出#1

    4
  • 输入#2

    1 1

    输出#2

    1
  • 输入#3

    99 50

    输出#3

    50

说明/提示

Sample 1 Explanation:
For a train consisting of five cars, the car that is second from the front is fourth from the back.

Constraints

  • 1≤K≤N≤1001 \leq K \leq N \leq 100
  • All input values are integers.

样例 1 解释:
对于一列由五节车厢组成的列车,从车头数起第二节车厢,是从车尾数起第四节车厢。

约束条件

  • 1≤K≤N≤1001 \leq K \leq N \leq 100
  • 所有输入值均为整数。

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

首页