시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
0.4 초 | 1024 MB | 53 | 9 | 8 | 16.000% |
Elly has a squared sheet of paper with N rows and M columns. The girl wants to fill each of the squares with red or blue. She insists that each square with a certain color has at least one more square with the same color in the same row or the same column ("so it does not feel alone").
For each square it is enough to have a matching-by-color square either оn the same row OR on the same column – but not necessarily both (although this is allowed). It is also allowed there to be more than one matching square in the same row or column – for example an entire row filled with red is okay. It is not required that both colors are used – thus the whole paper being blue for example might be a valid filling.
The girl now wonders in how many ways she can fill the sheet of paper. Two ways of filling are considered different, if there is a cell that is colored red in one of filling and blue in another.
On the only line of the standard input are given two integers N and M – the number of rows and columns of the paper, respectively.
On the standard output, print one integer: the number of different ways to fill the paper. Since the answer can be rather large, print only its remainder when divided by 1 000 000 007.
번호 | 배점 | 제한 |
---|---|---|
1 | 30 | 1 ≤ N, M ≤ 5 |
2 | 30 | 1 ≤ min(N, M) ≤ 7 |
3 | 40 | 1 ≤ N, M ≤ 50 |
3 3
284
5 4
898416
13 17
390317257
42 42
193467102