CF1608C Game Master
题目描述
$n$ 个选手正在进行一场比赛。
这场比赛有两个场地。现已明确每个选手在两个场地上的力量值。
有 $n-1$ 场交锋。每次交锋,裁判员从剩余的选手中任选两个,并从两个场地中任选一个。两个选手中,在该场地力量较弱的,会被淘汰。经过 $n-1$ 场交锋后,最终会剩下一位选手,为胜者。
对于每一个选手,判断他是否有机会成为胜者。
本题多测,每个测试点有 $t$ 组数据。
输入格式
第一行一个整数 $t$,表示该测试点数据组数。
对于每组测试数据:
第一行一个整数 $n$,表示选手数量;
第二行 $n$ 个整数 $a_1\dots a_n$,表示每个选手在第一个场地上的力量值。
第三行 $n$ 个整数 $b_1\dots b_n$,表示每个选手在第二个场地上的力量值。
数据保证,对于单组测试数据,$1\leq a_i,b_i\leq 10^9$,$a_i\neq a_j,b_i\neq b_j\forall i\neq j$;对于每个测试点,每组测试数据的 $n$ 之和不超过 $10^5$,且 $t\leq 100$。
输出格式
对于每一组测试数据,输出一行 $0-1$ 串;若对于第 $i$ 个选手,有机会成为胜者则该串第 $i$ 位为 $1$,否则为 $0$。
说明/提示
In the first test case, the $ 4 $ -th player will beat any other player on any game, so he will definitely win the tournament.
In the second test case, everyone can be a winner.
In the third test case, there is only one player. Clearly, he will win the tournament.