2.19号英语翻译


题目来源:https://acs.jxnu.edu.cn/problem/ICPCJX2020L

重点词汇:

Harem:n.后宫,闺房;

grumpy:adj.脾气暴躁的;

stump:v.使····为难,n.门柱;

infringe:v.违抗;

WZB's Harem

 WZB的后宫

 1000ms  131072K

描述:

Do you remember N-queens? Today, WZB accompanied his n queens to the cinema……

As the saying goes: Three queens for a play, one harem admits of no two queens…

Cinema uses n rows of seats, each row has n columns.Queens are grumpy, they're not willing to sit in the same row or same column with other queen, if there are two queens in the same row or same column they conflict occurs, so they make WZB arrange seats for them. It stumped WZB to avoid the queen make antinomy. WZB wants to know how many different arrangements there are for the queen, he'd like to choose one for them.

Since WZB and his queens arrived late, some seats had already been reserved by others. Although WZB is a king, he can't infringe on the rights of citizens, so the reserved seats could not be reserved for queens.

Now WZB has ordered you to work out how many ways to arrange the queen. If WZB finds out your calculations are wrong....

你还记得N皇后吗?今天,WZB陪着他的n位皇后去看电影……

俗话说:三皇后一戏,后宫不认两皇后……

电影院使用n排座位,每排n列。皇后脾气暴躁,他们不愿意与其他皇后坐在同一排或同一列,如果同一排或同一列有两个皇后,就会发生冲突,所以他们让WZB为他们安排座位。它难倒了WZB,以避免女王自相矛盾。 WZB想知道女王有多少种不同的安排,他想为他们选择一种。
由于WZB和他的皇后们来晚了,一些座位已经被其他人预定了。 WZB虽然是国王,但不能侵犯公民的权利,所以不能为王后预留座位。
现在WZB已经命令你计算出多少种方法来安排女王。如果 WZB 发现你的计算是错误的......

输入:

There is an integer n(n<=20)">n(n<=20)n(n<=20) in the firstline. The cinema has n rows and n columns of seats.

In the next lines,there are n integers ineach line(0 or 1).If the point(i,j)">(i,j)(i,j) is 1">11, it means it has been booked.

第一行有一个整数 n(n<=20)n(n<=20)。电影院有 n 行 n 列座位。
接下来的行,每行有n个整数(0或1)。如果点(i,j)(i,j)为11,则表示已预订

输出:

One integer.You just need to print the answer Mod 1000000007">10000000071000000007.

1000000007">一个整数。您只需打印答案 Mod 10000000071000000007。

样例输入:

2
0 0
0 0

样例输出:

4

相关