对
2026-09-08 19:50:59
发布于:江西
4阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
for ( int t=0; t<T; t++){
long long n,k,num;
bool b=false;
cin >> n >> k;
for ( int i=1; i<=n; i++){
cin >> num;
if ( i == k){b=true;cout << num << '\n';}
}
if ( !b)cout << -1 << '\n';
}
return 0;
}
这里空空如也


有帮助,赞一个