Logo
(追記) (追記ここまで)

19044번 - Entanglement 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB98181418.182%

문제

Consider an array $A$ of length $N$ and an array $B$ of length $M$. An entanglement of these two arrays is a matrix $C$ of size $N \times M$ such that for all 0ドル \le i \le N - 1$ and 0ドル \le j \le M - 1,ドル at least one of the following conditions holds: $C[i][j] = A[i]$ or $C[i][j] = B[j]$.

You are given a matrix $C$ of size $N \times M$ and a number $K$. Your task is to count the number of pairs of arrays $(A, B)$ such that:

  • $A$ has length $N$.
  • $B$ has length $M$.
  • $A$ and $B$ consist of values from the set $\{1, 2, \ldots, K\}$.
  • $C$ is an entanglement of $A$ and $B$.

Print the number of such pairs modulo 10ドル^9 + 7$.

입력

The first line of input contains three integers $N,ドル $M$ and $K$ (1ドル \le N, M \le 300,ドル 1ドル \le K \le N \times M$).

Each of the following $N$ lines contains $M$ integers separated by spaces, the $j$-th number on the $i$-th of these lines is $C[i - 1][j - 1]$.

출력

Print a single line containing a single integer: the number of pairs of arrays $(A, B)$ modulo 10ドル^9 + 7$.

제한

예제 입력 1

2 2 2
1 1
1 2

예제 출력 1

5

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2017 > Day 2: UniBuc Contest B번

Contest > Open Cup > 2017/2018 Season > Stage 1: Grand Prix of Romania B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /