SIRLRFanco @ 2022-07-30 21:03:04
#include<bits/stdc++.h>
using namespace std;
long long a[200002], b[200002];
long long n;
int main ()
{
ios::sync_with_stdio(0);
cin >> n;
for(int i = 1; i <= n; i++)
cin >> a[i];
for(int i = 1; i <= n; i += 2){
sort(a + 1, a + i + 1);
cout << a[(i + 1) / 2] << endl;
}
return 0;
}//挺麻烦是挺麻烦,关键过不了
//还有就是,本人输入输出流,不会用scanf, printf
by SIRLRFanco @ 2022-07-30 21:04:03
附:吸氧也没用 O2
by 快斗游鹿 @ 2022-07-30 21:32:00
这复杂度明显过不了啊。
by Azure__ @ 2022-07-30 21:44:12
建议自行学习二叉堆/优先队列
by xuekaiwen_emmm @ 2023-01-02 21:23:09
貌似之前有看到某位兄台思路差不多然后TLE,评论区众大佬说复杂度过高(貌似是O(N²logN)来着)