QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#10121. 色调

Statistics

画家矮人是一位魔法颜料大师,他拥有 $N$ 个颜料桶,每个桶里装着一种不同的颜色。当这些颜色的一个子集被涂在白色画布的同一块区域(非零面积)上时,就会产生一种特定的色调。不同的颜色子集会产生不同的色调。

村里的长老向画家矮人发起挑战,要求他创作一幅包含所有可能的 $2^N - 1$ 种色调的画作(这个数字排除了画布本身未涂任何颜色的色调)。画家矮人像“沙发土豆矮人”一样懒惰,他画了 $N$ 个圆,每个圆填充一种颜色。当他向长老展示这幅画时,长老们对杰作的精湛品质感到目瞪口呆。然而,他们并不确定是否所有的 $2^N - 1$ 种色调都确实以这种方式被创造了出来。请帮助他们完成这项任务。

输入格式

输入的第一行包含一个整数 $T$,表示测试用例的数量。

每个测试用例的第一行包含一个整数 $N$,表示圆的数量。接下来的 $N$ 行,每行包含三个整数 $x_i, y_i$ 和 $r_i$,用空格分隔,其中 $(x_i, y_i)$ 和 $r_i$ 分别表示填充了第 $i$ 种颜色的圆的圆心坐标和半径。没有三个圆相交于同一点。

数据范围

$1 \le T \le 200$,$1 \le N \le 200$,$-1\,000 \le x_i, y_i \le 1\,000$,$1 \le r_i \le 1\,000$,所有测试用例中 $N$ 的总和不超过 $200$。

输出格式

色调的描述是一个由 $N$ 个数字组成的序列,数字之间用单个空格分隔,每个数字要么是 $1$,要么是 $0$。当且仅当描述中的第 $i$ 个数字为 $1$ 时,第 $i$ 种颜色被用于创建该色调。

对于每个测试用例,如果画作包含了所有 $2^N - 1$ 种色调,请输出一行 YES。否则,输出两行:第一行包含 NO,第二行包含一种缺失色调的描述。如果画作中缺失了不止一种色调,你的程序可以输出其中任意一种的描述。请记住,只有当相应的颜色被放置在画布上非零面积的区域时,才会产生色调。你可以假设同一个测试用例中的所有圆都是两两不同的。

样例

样例输入 1

5
2
0 0 1
1 0 1
2
0 0 1
2 0 1
3
-1 0 2
1 0 2
0 1 2
5
0 0 4
5 -4 4
10 0 4
15 -4 4
20 0 4
5
0 0 7
0 3 4
3 0 4
0 -3 4
-3 0 4

样例输出 1

YES
NO
1 1
YES
NO
1 0 1 0 0
NO
0 1 0 0 0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.