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 SIXIANG32 @ 2020-03-30 10:28:31
@liqingyang 过了就好,这题真是毒瘤,scanf差不多也就是快读吧
by liqingyang @ 2020-03-30 10:29:13
@SIXIANG 差的多了!我比你快1s!
by SIXIANG32 @ 2020-03-30 10:29:50
@liqingyang 额,1s是评测姬的问题吧~~~
by liqingyang @ 2020-03-30 10:29:55
@SIXIANG 你看看我的最高,优化后200ms,比你少8倍还多!
by liqingyang @ 2020-03-30 10:30:30
@SIXIANG 一秒是评测机的问题?真是奇了怪了,洛谷评测机差出来1秒?
by SIXIANG32 @ 2020-03-30 10:50:21
@liqingyang 额,好吧
by chenwanqing @ 2020-05-03 17:48:32
nth_element加上scanf和printf的好习惯就可以A,不用OR也可以掐点过