/*
2020/4/16
二刷
*/
#include<stdio.h>
#include<algorithm>
using namespace std;
struct node
{
int data;
int index;
}input[100];
int N;
bool cmp(node a,node b)
{
if(a.data<b.data)
return true;
else return false;
}
int main()
{
scanf("%d",&N);
int ci = 1;
for(int i = 0;i<N;i++)
{
scanf("%d",&input[i].data);
input[i].index = ci++;
}
sort(input,input + N,cmp);
if(N%2 == 0)
printf("%d %d\n%d %d\n",input[N/2-1].data,input[N/2-1].index,input[N/2].data,input[N/2].index);
else
printf("%d %d\n",input[N/2].data,input[N/2].index);
return 0;
}
2017-1
最新推荐文章于 2023-07-03 15:14:53 发布