SIXIANG32 @ 2020-03-30 10:03:07
#include<iostream>
using namespace std;
bool flag[100000000];
int a;
int main()
{
int n,k,y=-1,min=100000000,max=0;
cin>>n>>k;
for(int p=1;p<=n;p++)
{
cin>>a;
flag[a]=0;
if(a<min)min=a;
if(a>max)max=a;
}
for(int p=min;p<=n;p++)
{
if(flag[p]==0)
y++;
if(y==k)
{
cout<<p<<endl;
return 0;
}
}
}
救救我吧qwqqAq
by liqingyang @ 2020-03-30 10:11:37
@tangrunxi 真的吗?
by liqingyang @ 2020-03-30 10:12:24
@tangrunxi 您貌似要打脸了。。。
by tangrunxi @ 2020-03-30 10:12:28
@liqingyang 为什么我超时了你没有
by liqingyang @ 2020-03-30 10:12:45
@SIXIANG 我已经A了,你可以看看
by liqingyang @ 2020-03-30 10:12:59
@tangrunxi 因为我加了快读开了O2
by tangrunxi @ 2020-03-30 10:13:47
@liqingyang 一样,我也加了快读开O2啊
by tangrunxi @ 2020-03-30 10:14:03
@liqingyang 这个
by liqingyang @ 2020-03-30 10:14:13
@tangrunxi 那就是您的是盗版的!
by liqingyang @ 2020-03-30 10:15:07
@tangrunxi 或许我的快读还加了fread,算了不管了,正经解法:https://www.luogu.com.cn/record/32301921
by liqingyang @ 2020-03-30 10:15:42
O2:210ms https://www.luogu.com.cn/record/32301955