Too Simple

TimeLimit: 2000/1000 MS (Java/Others)  MemoryLimit: 65536/65536 K (Java/Others)
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for help.

Teacher Mai has functions (that means for all ). But Rhason only knows some of these functions, and others are unknown.

She wants to know how many different function series there are that for every ,. Two function series and are considered different if and only if there exist ,.
Input
For each test case, the first lines contains two numbers n,m(1≤n,m≤100).

The following are m lines. In i-th line, there is one number −1 or n space-separated numbers.

If there is only one number −1, the function fi is unknown. Otherwise the j-th number in the i-th line means fi(j).
Output
For each test case print the answer modulo 10^9+7.
SampleInput
3 3
1 2 3
-1
3 2 1
SampleOutput
1
Hint
The order in the function series is determined. What she can do is to assign the values to the unknown functions.
Submit
题目统计信息详细
总AC数1
通过人数1
尝试人数4
总提交量7
AC率14.29%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: