msh20204401 @ 2024-10-06 18:38:49
为什么第4,5个样例TLE了
代码如下```c
using namespace std; long long a[5555555]; int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+n+1); cout<<a[m+1]<<endl; return 0; }
by msh20204401 @ 2024-10-06 18:39:38
求快速回复,略乱,深表歉意
by TangYouhang @ 2024-10-06 23:30:12
@msh20204401 我用scanf ac了
#include<bits/stdc++.h> using namespace std; long long a[5555555]; int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } sort(a+1,a+n+1); cout<<a[m+1]<<endl; return 0; }
by Lhy215 @ 2024-10-10 20:01:00
#include<bits/stdc++.h>
using namespace std; int
n,k,a[10000001]; int main(){ cin>>n>>k; for(int i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n); cout<<a[k]; }
略乱 抱歉,过了。
by Lhy215 @ 2024-10-10 20:08:27
求关
by msh20204401 @ 2024-10-12 20:51:27
@TangYouhang 非常感谢
by Devle @ 2024-10-17 01:29:14
@Lhy215 乐