Crni
의견: 0
Even though he has found all the most amusing rides, Mirko's enthusiasm still isn't fading. He opened his graph paper notebook and started colouring squares, and a new, even harder problem dawned on him.
You are given a square table consisting of \(N\) rows by \(N\) columns. Each cell is either black or white.
A set of cells forming a rectangle, with horizontal and vertical edges following cell borders, shall be called a black rectangle if all cells inside the rectangle are black and it consists of at least two cells.
Calculate the number of possible selections of two black rectangles that have no common cells. As the required number can be extremely large, you should output the remainder of dividing that number by \(10\,007\).
The first line of input contains the integer \(N\) (\(2 \le N \le 1000\)).
Each of the next \(N\) lines contains a single row of the table, consisting of \(N\) symbols. The symbol C represents a black cell, while B represents a white cell.
The first and only line of output must contain the remainder of dividing the required number by \(10\,007\).
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
2
CC
CC23
CCB
CCB
CBB55
BCCBB
BBCBB
BCCBB
BBBBB
CCBBB8평가 및 의견
Crni
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Crni