Submission #820004


Source Code Expand

Copy
import itertools,math,bisect,pprint,sys
h, w, a, b = map(int, raw_input().split())
mod = 10**9+7
ans = 0
def mod_fact(n):
    res = 1
    for i in range(1,n+1):
        res *= i
        res %= mod
    return res
def divmod(n):
    return pow(mod_fact(n),(mod-2),mod)
def C(n,r):
    return mod_fact(n)*divmod(n-r)*divmod(r)%mod
for i in range(b,w):
    ans += C(i+h-a-1,h-a-1) * C(a-1+w-i-1,a-1) % mod
print ans

Submission Info

Submission Time
Task D - Iroha and a Grid
User kaixiang
Language Python (2.7.6)
Score 0
Code Size 427 Byte
Status WA
Exec Time 2106 ms
Memory 10948 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
TLE × 1
AC × 7
WA × 7
TLE × 12
Set Name Test Cases
Sample subtask0_01.txt, subtask0_02.txt, subtask0_03.txt, subtask0_04.txt
All subtask0_01.txt, subtask0_02.txt, subtask0_03.txt, subtask0_04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_max.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_max.txt
Case Name Status Exec Time Memory
subtask0_01.txt AC 30 ms 2820 KB
subtask0_02.txt AC 27 ms 2692 KB
subtask0_03.txt AC 104 ms 5884 KB
subtask0_04.txt TLE 2102 ms 8468 KB
subtask1_01.txt WA 33 ms 2692 KB
subtask1_02.txt AC 27 ms 2692 KB
subtask1_03.txt WA 29 ms 2692 KB
subtask1_04.txt WA 27 ms 2692 KB
subtask1_05.txt AC 28 ms 2692 KB
subtask1_06.txt WA 27 ms 2692 KB
subtask1_07.txt WA 30 ms 2692 KB
subtask1_08.txt AC 27 ms 2692 KB
subtask1_09.txt WA 31 ms 2692 KB
subtask1_10.txt AC 27 ms 2692 KB
subtask1_max.txt WA 36 ms 2692 KB
subtask2_01.txt TLE 2102 ms 3068 KB
subtask2_02.txt TLE 2101 ms 3196 KB
subtask2_03.txt TLE 2105 ms 3068 KB
subtask2_04.txt TLE 2101 ms 3196 KB
subtask2_05.txt TLE 2105 ms 2940 KB
subtask2_06.txt TLE 2106 ms 9124 KB
subtask2_07.txt TLE 2102 ms 7548 KB
subtask2_08.txt TLE 2102 ms 9176 KB
subtask2_09.txt TLE 2106 ms 9796 KB
subtask2_10.txt TLE 2106 ms 10948 KB
subtask2_max.txt TLE 2105 ms 3324 KB