Submission #4029306
Source Code Expand
R, C = map(int, input().split()) X, Y = map(int, input().split()) D, L = map(int, input().split()) factorial = [] def mem_factorial(n) : factorial.append(1) factorial.append(1) for i in range(2, n+1) : factorial.append(factorial[i-1] * i) def comb(n, r) : return factorial[n] // (factorial[r] * factorial[n-r]) table = [[0 for j in range(Y+1)] for i in range(X+1)] def calc(x, y) : if x * y < D + L : return 0 elif table[x][y] == 0 : if x > 0 : calc(x-1, y) if y > 0 : calc(x, y-1) sum = comb(x*y,D+L)*comb(D+L,L) for i in range(x+1) : for j in range(y+1) : sum -= (x-i+1)*(y-j+1)*table[i][j] table[x][y] = sum return sum else : return table[x][y] mem_factorial(X*Y) print(calc(X,Y)*(R-X+1)*(C-Y+1) % 1000000007)
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder社の給料 |
User | zurukumo |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 799 Byte |
Status | RE |
Exec Time | 18 ms |
Memory | 3064 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 00_sample_01.txt, 00_sample_02.txt, test_100.txt, test_14.txt, test_29.txt, test_4.txt, test_42.txt, test_48.txt, test_54.txt, test_59.txt, test_71.txt, test_72.txt, test_84.txt, test_96.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | RE | 18 ms | 3064 KB |
00_sample_02.txt | RE | 18 ms | 3064 KB |
test_100.txt | RE | 18 ms | 3064 KB |
test_14.txt | RE | 18 ms | 3064 KB |
test_29.txt | RE | 18 ms | 3064 KB |
test_4.txt | RE | 18 ms | 3064 KB |
test_42.txt | RE | 18 ms | 3064 KB |
test_48.txt | RE | 18 ms | 3064 KB |
test_54.txt | RE | 18 ms | 3064 KB |
test_59.txt | RE | 18 ms | 3064 KB |
test_71.txt | RE | 18 ms | 3064 KB |
test_72.txt | RE | 18 ms | 3064 KB |
test_84.txt | RE | 18 ms | 3064 KB |
test_96.txt | RE | 18 ms | 3064 KB |