编辑代码

// 设置标准输入接口
const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;

void (async function () {
  const n = Number(await readline());
  const arr = (await readline())
    .split(" ")
    .map(Number)
    .sort((a, b) => a - b);
  if (n % 2 == 1) {
    return console.log(arr[Math.floor(n / 2)]);
  }
  console.log(arr[Math.floor(n / 2) - 1]);
})();