230syh @ 2021-08-31 11:23:57
//cpp
#include<bits/stdc++.h>
using namespace std;
set<int>a;
int main(){
int n,k,x;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>x;
a.insert(x);
}
set<int>::iterator it;
for(int i=0;i<=k;i++)
it++;
cout<<(*it);
}
by int64 @ 2021-08-31 11:24:42
@230syh Runtime Error
by 一只大龙猫 @ 2021-08-31 11:25:47
@230syh 运行时错误,你的set<int>::iterator it;
没初始化
by 230syh @ 2021-08-31 11:33:38
初始化就WA3,TLE2,AC0
by 王熙文 @ 2021-08-31 12:26:05
for(int i=0;i<=k;i++)
从 1 开始
还有 set 会去重,所以这样不行
by 230syh @ 2021-08-31 16:40:27
@王熙文 谢谢AC了两组
by 230syh @ 2021-08-31 16:41:59
@王熙文 AC+1