baen @ 2024-01-16 11:16:07
#include<bits/stdc++.h>
using namespace std;
long long A[100005]={0},S[100005]={0},O[100005]={0};
map<long long,int> M;
int N;
int main()
{
cin>>N;
for(int i=1;i<=N;i++)
{
cin>>A[i];
S[i]=A[i];
}
sort(S+1,S+N+1);
for(int i=1;i<=N;i++)
M[S[i]]=i;
for(int i=1;i<=N;i++)
O[i]=M[A[i]];
for(int i=1;i<=N;i+=2)
{
sort(O+1,O+i+1);
cout<<S[O[(i+1)/2]]<<endl;
}
return 0;
}
by Syncc @ 2024-01-16 11:49:16
对于
100\% 的数据,1 \le N ≤ 100000 ,0 \le A_i \le 10^9 。
by SSqwq_ @ 2024-01-16 13:04:17
@baen 一眼丁真,鉴定为
老哥你真不如去写个
by baen @ 2024-01-16 14:29:04
@Razer_System
不用long long是吧
by baen @ 2024-01-16 14:29:49
@Summer_Sheep
裂开
只是刚学map,想试一下
by baen @ 2024-01-16 14:34:30
还有救吗这个代码
/(ㄒoㄒ)/~~
by OldDriverTree @ 2024-01-16 21:36:44
@baen 你这离散化和不离散化没有区别啊
by baen @ 2024-01-17 10:01:46
裂开