60re求助

P1923 【深基9.例4】求第 k 小的数

ACwjr @ 2025-01-02 11:10:19

#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[100001];
signed main() {
    int n,k;
    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n);
    cout<<a[k];
    return 0;
}


by IKUN54088DS @ 2025-01-02 12:19:09

数组开大


by ACwjr @ 2025-01-03 09:53:27

@IKUN54088DSTLE了


by IKUN54088DS @ 2025-01-03 12:03:06

scanf和printf


by IKUN54088DS @ 2025-01-03 12:04:28

sort换成stable_sort@ACwjr


|