#abc277a. A - ^{-1}
A - ^{-1}
Score : points
问题描述
给定一个序列 ,它是 的一个排列,并给定一个整数 。序列 的第 项的值为 。请输出满足 的 值。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence that is a permutation of , and an integer . The -th term of has a value of . Print such that .
Constraints
- is a permutation of .
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
4 3
2 3 1 4
Sample Output 1
2
We have , so . Thus, you should print .
Sample Input 2
5 2
3 5 1 4 2
Sample Output 2
5
Sample Input 3
6 6
1 2 3 4 5 6
Sample Output 3
6
update @ 2024/3/10 11:38:53