OIer_Kevin @ 2023-04-03 20:04:43
虽然我很震惊我居然没有TLE,但……这RE是怎么肥事?!RE
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int a[1000000],n,k;
int main(){
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
cout<<a[k];
return 0;
}
by GSRgsrgsr @ 2023-04-03 20:30:10
n不是<=5e6吗,为什么数组只开到1e6?
by LEle0309 @ 2023-04-04 07:18:36
《60分》
by LEle0309 @ 2023-04-04 07:20:49
@ganyudetinali
nlogn过不去
by CloudsUnfolding @ 2023-04-04 15:04:43
@ganyudetinali 数组开小了一般会爆RE
by CloudsUnfolding @ 2023-04-04 15:05:44
@WhuCloudVolume 习惯上开题上所给范围加上10,本题就是5e6 + 10.
by CloudsUnfolding @ 2023-04-04 15:06:20
@WhuCloudVolume 但是这题用sort过不了hhh。