QwQ,快排40分,(雾:AC AC WA TLE TLE

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

Max6700 @ 2023-05-10 22:40:06

#include<bits/stdc++.h>
using namespace std;

int n,m;
int a[5000010];

int main(){

    scanf("%d %d",&n,&m);

    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }

    sort(a+1,a+n);

    cout<<a[m+1];

    return 0;
}

by tZEROちゃん @ 2023-05-11 19:41:19

@Max6700 看题解。


by Max6700 @ 2023-05-11 19:42:46

@tZEROちゃん 《简单干脆》


by GeorgeAAAADHD @ 2023-05-11 19:44:42

@Max6700 不会超时啊?我试过了。


by GeorgeAAAADHD @ 2023-05-11 19:46:37

@Max6700 this record


by Max6700 @ 2023-05-11 20:10:20

@GeorgeAAAADHD

(雾++

?????


by Max6700 @ 2023-05-11 20:11:56

@GeorgeAAAADHD yuo see:

#include<bits/stdc++.h>
using namespace std;

long long n,m;
long long a[5000010];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cin>>n>>m;

    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }

    sort(a+1,a+n+1);

    cout<<a[m+1];

    return 0;
}

and

this


by tZEROちゃん @ 2023-05-11 20:17:13

@Max6700 勾上o2优化试试

难蚌但是这个应该不是正解


by Max6700 @ 2023-05-11 20:19:14

@tZEROちゃん

a!

吸氧过了!!!!!!!!

再不过我就要撅望力

验证码:mmkt祭

谢谢dalao的各种卡时间大法


by sdsswyh @ 2023-06-03 12:24:24

开O2


上一页 |