200±10ms与3.25MB结合的怪物
2026-07-17 10:54:29
发布于:上海
33阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t,n,k;
long long x;
bool found;
cin>>t;
while(t--){
cin>>n>>k;
found=false;
for(int i=1;i<=n;++i){
cin>>x;
if(i==k){
cout<<x;
found=true;
}
}
if(!found)cout<<-1;
cout<<'\n';
}
return 0;
}
特别鸣谢:千问
全部评论 1
666
1周前 来自 上海
0








有帮助,赞一个