CF1697E.Coloring
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n points on the plane, the coordinates of the i -th point are (xi,yi) . No two points have the same coordinates.
The distance between points i and j is defined as d(i,j)=∣xi−xj∣+∣yi−yj∣ .
For each point, you have to choose a color, represented by an integer from 1 to n . For every ordered triple of different points (a,b,c) , the following constraints should be met:
- if a , b and c have the same color, then d(a,b)=d(a,c)=d(b,c) ;
- if a and b have the same color, and the color of c is different from the color of a , then d(a,b)<d(a,c) and d(a,b)<d(b,c) .
Calculate the number of different ways to choose the colors that meet these constraints.
输入格式
The first line contains one integer n ( 2≤n≤100 ) — the number of points.
Then n lines follow. The i -th of them contains two integers xi and yi ( 0≤xi,yi≤108 ).
No two points have the same coordinates (i. e. if i=j , then either xi=xj or yi=yj ).
输出格式
Print one integer — the number of ways to choose the colors for the points. Since it can be large, print it modulo 998244353 .
输入输出样例
输入#1
3 1 0 3 0 2 1
输出#1
9
输入#2
5 1 2 2 4 3 4 4 4 1 3
输出#2
240
输入#3
4 1 0 3 0 2 1 2 0
输出#3
24
说明/提示
In the first test, the following ways to choose the colors are suitable:
- [1,1,1] ;
- [2,2,2] ;
- [3,3,3] ;
- [1,2,3] ;
- [1,3,2] ;
- [2,1,3] ;
- [2,3,1] ;
- [3,1,2] ;
- [3,2,1] .