第一个wa,其它全re,朋友说这个很简单,真的吗?真的

P1168 中位数

你真的开代码公开计划了吗。
by _sunkuangzheng_ @ 2024-01-10 18:18:50


@[not_much](/user/1189340) 您貌似开了非团队管理不许看您代码。 这个题是挺简单的
by _qingshu_ @ 2024-01-10 18:21:16


```cpp #include<bits/stdc++.h> using namespace std; long long a[1000]; long long n; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(i%2==1){ sort(a+1,a+i); cout<<a[i/2+1]<<endl; } } return 0; }
by not_much @ 2024-01-10 18:23:59


@[not_much](/user/1189340) [this](https://www.luogu.com.cn/record/142441304) 您好,这边您数组开小了,排序写错了,然后这份提交是您该思路的极限(大改) 这道题需要二分插入 vector 实现
by _qingshu_ @ 2024-01-10 18:26:15


@[not_much](/user/1189340) 您好,您代码时间复杂度为 $O(n^2 \log n)$,无法通过本题。
by xiaoshumiao @ 2024-01-10 18:29:09


|