ビルの飾りつけ 4 (Building 4)
题意翻译
给 $2n$ 个数对 $(a_i,b_i)$,构造一个非降序列 $c_i$ 满足 $\forall 1\le i\le n,c_i\in\{a_i,b_i\}$,且 $c_i=a_i$ 的位置恰好有 $n$ 个。
无解输出 $-1$。
数据范围:$n\le 5\times 10^5$。
题目描述
[problemUrl]: https://atcoder.jp/contests/joisc2020/tasks/joisc2020_a