ZhenlongDai/ACPR huggingface dataset:
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
dp = [[0]*13 for i in range(len(S))]
MOD = 10**9+7

if S[-1] == "?":
    for i in range(10):
        dp[0][i] = 1
else:
    dp[0][int(S[-1])] = 1

t = 1
for i, c in enumerate(S[::-1]):
    t = (t*10) % 13
    for j in range(13):
        if c == "?":
            for k in range(10):
                nj = (k*t+j) % 13
                dp[i][nj] += dp[i-1][j]
                dp[i][nj] %= MOD
        else:
            nj = (int(c)*t+j) % 13
            dp[i][nj] += dp[i-1][j]
            dp[i][nj] %= MOD
print(dp[-1][5])

Failing test case input:
45?

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
from sys import stdin
S = (stdin.readline().rstrip())
dp = [[0]*13 for i in range(len(S)+1)]
MOD = 10**9+7
 
S = list(reversed(S))
dp[0][0] = 1
 
t = 1
for i, c in enumerate(S, 1):
    for j in range(13):
        if c == "?":
            for k in range(10):
                nj = (k*t+j) % 13
                dp[i][nj] = dp[i][nj] + dp[i-1][j]
                dp[i][nj] %= MOD
        else:
            nj = (int(c)*t+j) % 13
            dp[i][nj] = dp[i][nj] + dp[i-1][j]
            dp[i][nj] %= MOD
    t = (t*10)%13
print(dp[-1][5])

Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def main():
    S = list(str(input()))
    a = len(S)
    dp = [[0 for _ in range(13)] for _ in range(a+1)]
    dp[0][0] = 1
    INF = 10**9+7
    
    for i in range(a):
        if S[i] == "?":
            for j in range(10):
                for k in range(13):
                    dp[i+1][(10*k+j)%13] += dp[i][k]%INF
        else:
            for k in range(13):
                dp[i+1][(10*k+int(S[i]))%13] += dp[i][k]%INF
    
    print(dp[-1][5])
    
if __name__ == "__main__":
    main()

Failing test case input:
?6?42???8??29?06233????9??3???7258??5??7???????774????4?1??17?????5?70???86???

Expected output:
153716877


Actual output:
6153716919


Fixed submission (verdict: Accepted):
import sys


def main():
    s = str(input())
    l = len(s)
    ans = [0 for _ in range(13)]
    MOD = 10**9+7
    ans[0] = 1
    
    for st in s:
        dp = [0 for _ in range(13)]
        for i in range(13):
            dp[(10*i)%13] = ans[i]%MOD
        dp += dp
        if st != "?":
            for i in range(13):
                num = int(st)
                ans[i] = dp[i+13-num]
        else:
            for i in range(13):
                ans[i] = sum(dp[i+4:i+14])
    
    print(ans[5]%MOD)

if __name__ == "__main__":
    main()
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

s=input()
s=s[::-1]
n=len(s)
dp=[[0 for _ in range(13)] for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
	if s[i]=="?":
		c=-1
	else:
		c=int(s[i])
	for j in range(10):
		if c!=-1 and c!=j:
			continue
		for ki in range(13):
			dp[i+1][(ki*10+j)%13]+=dp[i][ki]
	for j in range(13):
		dp[i+1][j]%=(10**9+7)
print(dp[n][5])

Failing test case input:
84?

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):

s=input()
n=len(s)
dp=[[0 for _ in range(13)] for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
	if s[i]=="?":
		c=-1
	else:
		c=int(s[i])
	for j in range(10):
		if c!=-1 and c!=j:
			continue
		for ki in range(13):
			dp[i+1][(ki*10+j)%13]+=dp[i][ki]
	for j in range(13):
		dp[i+1][j]%=(10**9+7)
print(dp[n][5]%(10**9+7))

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import copy




N = 13
MOD = 1000000000 + 7
s = input()
dp = [0 for i in range(N)]
dp[0] = 1

for i, si in enumerate(reversed(s)):

    nextdp = [0 for i in range(N)]
    for j in range(10):
        c = 0
        if si == "?":
            c = (j * 10 ** i) % N
        elif j == 0:
            c = (int(si) * (i + 1)) % N
        else:
            break

        for k in range(N):
            nextdp[(k + c) % N] += dp[k]
            nextdp[(k + c) % N] %= MOD

    dp = copy.copy(nextdp)

print(dp[5])


Failing test case input:
54?

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):




N = 13
MOD = 10 ** 9 + 7

s = input()[::-1]

dp = [0 for i in range(N)]
nextdp = [0 for i in range(N)]
zeros = [0 for i in range(N)]
dp[0] = 1

r = 1
for i, si in enumerate(s):
    nextdp = zeros[:]

    for j in range(10):
        jj = j
        if si == "?":
            pass
            
        elif j == 0:
            jj = int(si)
        else:
            break

        for k in range(N):
            l = (k + r * jj) % N
            nextdp[l] = (nextdp[l] + dp[k]) % MOD

    dp = nextdp
    r = r * 10 % N

print(dp[5])

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
N = len(S)
DP =[0]*13
DP[0] = 1
A = 0
MOD = 10**9+7

B = [[0]*13 for i in range(13)]
for i in range(13):
    for j in range(13):
        B[i][j] = (i*j)%13
T = [1,10,9,12,3,4]
A = 0
for i in range(N):
    A*=10
    if S[i] == "?":
        hoge = [0]*13
        for j in range(13):
            for k in range(10):
                hoge[(j+k*T[(N-i-1)%6])%13] = (hoge[(j+k*T[(N-i-1)%6])%13] + DP[j])%MOD
        DP = hoge[:]
    else:
        A = (A+int(S[i]))%13
print(DP[(A+5)%13])

Failing test case input:
4?7

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
S = input()
N = len(S)
DP =[0]*13
DP[0] = 1
A = 0
MOD = 10**9+7

T = [1,10,9,12,3,4]
A = 0
for i in range(N):
    A*=10
    if S[i] == "?":
        hoge = [0]*13
        for j in range(13):
            for k in range(10):
                hoge[(j+k*T[(N-i-1)%6])%13] = (hoge[(j+k*T[(N-i-1)%6])%13] + DP[j])%MOD
        DP = hoge[:]
    else:
        A += int(S[i])
    A = A%13
print(DP[(5-A)%13])
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
n = len(s)
MOD = 10**9 + 7
dp = [[0]*13 for _ in range(n+1)]


dp[0][0] = 1

for i in range(n):
    if s[i] != "?":
        for j in range(13):
            dp[i+1][(10*j+int(s[i])) % 13] = dp[i+1][(10*j+int(s[i])) % 13] + dp[i][j] % MOD
    else:
        for k in range(10):
            for j in range(13):
                dp[i+1][(10*j+k) % 13] = dp[i+1][(10*j+k) % 13] + dp[i][j] % MOD
print(dp[n][5])

Failing test case input:
???67???07?5?????71??1?4????477???????7??5??8526???3??9????34260?92??8???24?6?

Expected output:
153716933


Actual output:
6153716975


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
MOD = 10**9 + 7
dp = [[0]*13 for _ in range(n+1)]


dp[0][0] = 1

for i in range(n):
    if s[i] != "?":
        for j in range(13):
            dp[i+1][(10*j+int(s[i])) % 13] = dp[i+1][(10*j+int(s[i])) % 13] + dp[i][j] % MOD
    else:
        for k in range(10):
            for j in range(13):
                dp[i+1][(10*j+k) % 13] = dp[i+1][(10*j+k) % 13] + dp[i][j] % MOD
print(dp[n][5]%MOD)

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
mod = 10 ** 9 + 7

s = input()

cur = [0] * 13
c = s[-1]
if c != '?':
    cur[int(c)] = 1
else:
    for j in range(10):
        cur[j] = 1

d = 10
for c in s[::-1]:
    if c != '?':
        l = [int(c)]
    else:
        l = [j for j in range(10)]
    tmp = [0] * 13
    for j in l:
        for k in range(13):
            ind = (j * d + k) % 13
            tmp[ind] += cur[k] % mod
    cur = tmp
    d *= 10
print(cur[5])

Failing test case input:
?6?42???8??29?16233????9??3???7258??5??7???????774????4?1??17?????5?70???76???

Expected output:
153716940


Actual output:
1537168653


Fixed submission (verdict: Accepted):
mod = 10 ** 9 + 7

s = input()

cur = [0] * 13
cur[0] = 1
d = 1
for c in s[::-1]:
    if c != '?':
        l = [int(c)]
    else:
        l = [j for j in range(10)]
    tmp = [0] * 13
    for j in l:
        for k in range(13):
            ind = (j * d + k) % 13
            tmp[ind] += cur[k]
            tmp[ind] %= mod
    cur = tmp
    d *= 10
    d %= 13
print(cur[5])
Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


def main():
    s = str(input())
    l = len(s)
    ans = [0 for _ in range(13)]
    MOD = 10**9+7
    ans[0] = 1
    print(len(s))
    
    for st in s:
        dp = [0 for _ in range(13)]
        for i in range(13):
            dp[(10*i)%13] = ans[i]%MOD
        dp += dp
        if st != "?":
            for i in range(13):
                num = int(st)
                ans[i] = dp[i+13-num]
        else:
            for i in range(13):
                ans[i] = sum(dp[i+4:i+14])
    
    print(ans[5]%MOD)

if __name__ == "__main__":
    main()

Failing test case input:
54?

Expected output:
0


Actual output:
3
0


Fixed submission (verdict: Accepted):
import sys


def main():
    s = str(input())
    l = len(s)
    ans = [0 for _ in range(13)]
    MOD = 10**9+7
    ans[0] = 1
    
    for st in s:
        dp = [0 for _ in range(13)]
        for i in range(13):
            dp[(10*i)%13] = ans[i]%MOD
        dp += dp
        if st != "?":
            for i in range(13):
                num = int(st)
                ans[i] = dp[i+13-num]
        else:
            for i in range(13):
                ans[i] = sum(dp[i+4:i+14])
    
    print(ans[5]%MOD)

if __name__ == "__main__":
    main()

Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r = [[(j - k) * 9 % 13 for j in range(10)] for k in range(13)]
d = [1] + [0] * 12

for c in input():
    if c == '?':
        d = [sum(d[j] for j in k) for k in r]
    else:
        d = [d[(int(c) - k) * 9 % 13] for k in range(13)]
    
print(d[5])

Failing test case input:
???67???07?5?????71??1?4????477???????7??5??8537???3??9????34260?92??8???24?6?

Expected output:
153716675


Actual output:
7692307692307692307692307692307692307692307497


Fixed submission (verdict: Accepted):
r = [[(j - k) * 9 % 13 for j in range(10)] for k in range(13)]
d = [1] + [0] * 12
M = 10 ** 9 + 7
for c in input():
    if c == '?':
        d = [sum(d[j] for j in k) % M for k in r]
    else:
        d = [d[(int(c) - k) * 9 % 13] for k in range(13)]
    
print(d[5])

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
d=[0]*13
d[0]=1
for i in s:
    dnew=[0]*13
    if i=="?":
        for j in range(10):
            for k in range(13):
                dnew[(10*k+j)%13]+=d[k]
                dnew[k]%=(10**9+7)
    else:
        for k in range(13):
            dnew[(10*k+int(i))%13]+=d[k]
            dnew[k]%=(10**9+7)
    d=dnew

print(d[5])

Failing test case input:
?6?42???8??2??06243????9??3???7258??5??7???????784????4?1??17???9?5?70???76???

Expected output:
153716888


Actual output:
1153716895


Fixed submission (verdict: Accepted):
s=input()
d=[0]*13
d[0]=1
for i in s:
    dnew=[0]*13
    if i=="?":
        for j in range(10):
            for k in range(13):
                dnew[(10*k+j)%13]+=d[k]
            for k in range(13):
                dnew[k]%=(10**9+7)
    else:
        for k in range(13):
            dnew[(10*k+int(i))%13]+=d[k]
        for k in range(13):
            dnew[k]%=(10**9+7)
    d=dnew

print(d[5])
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def inpl(): return list(map(int, input().split()))

MOD = 10**9 + 7
S = input()[::-1]
x = 1

DP = [0]*13
DP[0] = 1
for i in range(len(S)):
    DP2 = [0]*13
    if S[i] != "?":
        s = int(S[i])
        for i in range(13):
            DP2[(i + s*x)%13] = DP[i]%MOD
    else:
        for j in range(10):
            for i in range(13):
                DP2[(i + j*x)%13] = (DP2[(i + j*x)%13] + DP[i])%MOD
    x = x*10%MOD
    DP = DP2

print(DP[5]%MOD)


Failing test case input:
?6?426??8??29?06233????9??3???7258??5??7???????774????4?1??17?????5?70???8????

Expected output:
153716913


Actual output:
153723978


Fixed submission (verdict: Accepted):
def inpl(): return list(map(int, input().split()))

MOD = 10**9 + 7
S = input()[::-1]
x = 1

DP = [0]*13
DP[0] = 1
for i in range(len(S)):
    DP2 = [0]*13
    if S[i] != "?":
        s = int(S[i])
        for i in range(13):
            DP2[(i + s*x)%13] = DP[i]%MOD
    else:
        for j in range(10):
            for i in range(13):
                DP2[(i + j*x)%13] = (DP2[(i + j*x)%13] + DP[i])%MOD
    x = x*10%13
    DP = DP2

print(DP[5]%MOD)

Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
import heapq
import bisect

MOD = 10**9+7

S = input()
ans = [1]+[0]*12
 
for c in S:
    dp=[0]*13
    for i in range(13):
        
        dp[(i*10)%13]=ans[i]%MOD
    
    dp+=dp
 
    if c=='?':
        for i in range(13):
            
            ans[i]=sum(dp[i+4:i+14])
    else:
        for i in range(13):
            ans[i]=dp[i+13-int(c)]

print(ans[5])

Failing test case input:
????8???07?5?????71??1?4????477????6??8??5??8527???3??9????23270?92??8???24?6?

Expected output:
153716693


Actual output:
6153716735


Fixed submission (verdict: Accepted):

import math
import heapq
import bisect

MOD = 10**9+7

S = input()
ans = [0]*13
ans[0]=1
 
for c in S:
    dp=[0]*13
    for i in range(13):
        
        dp[(i*10)%13]=ans[i]%MOD
    
    dp+=dp
 
    if c=='?':
        for i in range(13):
            
            ans[i]=sum(dp[i+4:i+14])
    else:
        for i in range(13):
            ans[i]=dp[i+13-int(c)]

print(ans[5]%MOD)
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=list(input())
s.reverse()

dp = [[0 for _ in range(13)] for _ in range(len(s)+1)]
dp[0][0]=1
for i in range(len(s)):
    nd=s[i]
    for mod in range(13):
        dp[i][mod] %=10**9+7
        for d in range(10):
            if nd != "?" and str(d)!=nd:
                continue
            nmod = (mod*10 + d) % 13
            dp[i+1][nmod] += dp[i][mod]

print(dp[-1][5])

Failing test case input:
???67???07?6?????8???1?4????477???????7??5??8527???3??91???34160?92??8???24?6?

Expected output:
153716870


Actual output:
6153716917


Fixed submission (verdict: Accepted):
s=list(input())
s.reverse()

MOD=10**9+7
dp = [[0 for _ in range(13)] for _ in range(len(s)+1)]
dp[0][0]=1
keta=1
for i in range(len(s)):
    nd=s[i]
    for mod in range(13):
        dp[i][mod] %=MOD
        if dp[i][mod]==0:
            continue

        for d in range(10):
            if nd != "?" and str(d)!=nd:
                continue
            nmod=(d*keta + mod) % 13
            dp[i+1][nmod] += dp[i][mod]
    keta*=10
    keta%=13

print(dp[-1][5]%MOD)

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
K = 1000000007
S = input()
l = len(S)
li = [1] + [0] * 12
work_lists = [[0] * 13] * 6
for i in range(6):
    for x in range(10):
        work_lists[i][x * (10 ** (i % 6)) % 13] = 1
for i in range(l):
    s = S[l - i - 1]
    if s == "?":
        work_li = work_lists[i % 6]
        next_li = [sum([work_li[j] * li[(k - j) % 13] % K for j in range(13)]) for k in range(13)]
    else:
        n = int(s)
        r = (n * (10 ** i)) % 13
        next_li = [li[(j - r) % 13] for j in range(13)]
    li = next_li
print(li[5])


Failing test case input:
?6?33???8?729?16233????9??3???7258??5??7???????774?????41??17?????5?70????6???

Expected output:
153716884


Actual output:
4008923828


Fixed submission (verdict: Accepted):
K = 1000000007
S = input()
l = len(S)
li = [1] + [0] * 12
work_lists = [[0] * 13 for i in range(6)]
for i in range(6):
    for x in range(10):
        work_lists[i][(x * (10 ** i)) % 13] = 1
for i in range(l):
    s = S[l - i - 1]
    if s == "?":
        work_li = work_lists[i % 6]
        next_li = [sum([work_li[j] * li[(k - j) % 13] for j in range(13)]) % K for k in range(13)]
    else:
        n = int(s)
        r = (n * (10 ** (i % 6))) % 13
        next_li = [li[(j - r) % 13] for j in range(13)]
    li = next_li
print(li[5])
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import copy





N = 13
MOD = 10 ** 9 + 7

s = input()
rs = reversed(s)

dp = [0 for i in range(N)]
dp[0] = 1
zeros = [0 for i in range(N)]

for i, si in enumerate(rs):
    nextdp = zeros

    for j in range(10):
        c = 0
        if si == "?":
            c = (j * 10 ** i) % N
        elif j == 0:
            c = (int(si) * 10 ** i) % N
        else:
            break

        for k in range(N):
            nextdp[(k + c) % N] = (nextdp[(k + c) % N] + dp[k]) % MOD

    dp = nextdp

print(dp[5])


Failing test case input:
?67

Expected output:
1


Actual output:
5252


Fixed submission (verdict: Accepted):




N = 13
MOD = 10 ** 9 + 7

s = input()[::-1]

dp = [0 for i in range(N)]
nextdp = [0 for i in range(N)]
zeros = [0 for i in range(N)]
dp[0] = 1

r = 1
for i, si in enumerate(s):
    nextdp = zeros[:]

    for j in range(10):
        jj = j
        if si == "?":
            pass
            
        elif j == 0:
            jj = int(si)
        else:
            break

        for k in range(N):
            l = (k + r * jj) % N
            nextdp[l] = (nextdp[l] + dp[k]) % MOD

    dp = nextdp
    r = r * 10 % N

print(dp[5])

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

S = input()

s = list(S)

s.reverse()



lis = [0] * 13
lis[0] = 1
keta = 1

for i in range(len(S)):

    nlis = [0] * 13

    if s[i] == "?":

        for j in range(10):

            for k in range(13):

                nlis[ (k + (j * keta)) % 13] += lis[k]

    else:

        now = int(s[i])

        for k in range(13):

            nlis[ (k + (now * keta)) % 13 ] += lis[k]

    
    keta *= 10
    for j in range(13):
        nlis[j] = lis[j]


print (lis[5] % (10**9 + 7))


Failing test case input:
?6?42???8??29?06233????9??3???7258??5??8??????0774????4?1??17?????5?7????86???

Expected output:
153716844


Actual output:
0


Fixed submission (verdict: Accepted):

S = input()

s = list(S)

s.reverse()



lis = [0] * 13
lis[0] = 1
keta = 1

for i in range(len(S)):

    nlis = [0] * 13



    for j in range(10):

        for k in range(13):

            if s[i]== "?" or j == int(s[i]):
                nlis[ (k + (j * keta)) % 13] += lis[k]

    keta *= 10
    keta = keta % 13
    for j in range(13):
        lis[j] = nlis[j] % (10**9 + 7)


print (lis[5] % (10**9 + 7))
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

MOD = 10 ** 9 + 7
MAX_LEN = len(S)
dp = [[0] * 13 for _ in range(MAX_LEN + 1)]
dp[0][0] = 1
S = S[::-1]

for i in range(MAX_LEN):
    c = int(S[i]) if S[i] != '?' else -1
    for j in range(10):
        if c != -1 and c != j:
            continue
        
        for k in range(13):
            dp[i + 1][(k * 10 + j) % 13] += dp[i][k]

        dp[i + 1][j] %= MOD
        
print(dp[-1][5])


Failing test case input:
?48

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
S = input()

MOD = 10 ** 9 + 7
MAX_LEN = len(S)
dp = [[0] * 13 for _ in range(MAX_LEN + 1)]
dp[0][0] = 1

for i in range(MAX_LEN):
    c = int(S[i]) if S[i] != '?' else -1
    for j in range(10):
        if c != -1 and c != j:
            continue
        
        for k in range(13):
            idx = (k * 10 + j) % 13
            dp[i + 1][idx] += dp[i][k]
            dp[i + 1][idx] %= MOD
        
print(dp[-1][5])

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
MOD = 10 ** 9 + 7

S = input()
N = len(S)

dp = [[0] * 13 for _ in range(N + 1)]
dp[0][0] = 1

mul = 1

for i, x in enumerate(S[::-1]):
  if x == "?":
    for k in range(10):
      for j in range(13):
        jj = (mul * k + j) % 13
        dp[i + 1][jj] += dp[i][j]
        dp[i + 1][jj] %= MOD
  else:
    k = int(x)
    for j in range(13):
      jj = (mul * k + j) % 13
      dp[i + 1][jj] += dp[i][j]
      dp[i + 1][jj] %= MOD

  mul = (mul * 10) % MOD

print(dp[N][5])


Failing test case input:
????8???07?5?????71????4????477????6??8??5??8527?1?3??9????23160?92??8???24?6?

Expected output:
153716451


Actual output:
153309178


Fixed submission (verdict: Accepted):
MOD = 10 ** 9 + 7

S = input()
N = len(S)

dp = [[0] * 13 for _ in range(N + 1)]
dp[0][0] = 1

mul = 1

for i, x in enumerate(S[::-1]):
  if x == "?":
    for k in range(10):
      for j in range(13):
        jj = (mul * k + j) % 13
        dp[i + 1][jj] += dp[i][j]
        dp[i + 1][jj] %= MOD
  else:
    k = int(x)
    for j in range(13):
      jj = (mul * k + j) % 13
      dp[i + 1][jj] += dp[i][j]
      dp[i + 1][jj] %= MOD

  mul = (mul * 10) % 13

print(dp[N][5])
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
x = 1000000007

S = input()
S = [int(s) if s != '?' else s for s in S]
S = S[::-1]

dp = [[0 for j in range(13)] for i in range(len(S) + 1)]

dp[0][0] = 1

for i, s in enumerate(S):
    for j in range(10):
        if s != '?' and s != j:
            continue

        digit_r = ((10 ** i) * j) % 13

        for k in range(13):
            r = (digit_r + k) % 13
            dp[i + 1][r] += dp[i][k]

    dp[i + 1][r] %= 13

print(int(dp[-1][5] % x))


Failing test case input:
???67???07?5?????71??1?4????477???????7??5??8526???3??9????34260?92??8???24?6?

Expected output:
153716933


Actual output:
286989953


Fixed submission (verdict: Accepted):
x = 1000000007

S = input()
S = [int(s) if s != '?' else s for s in S]

dp = [[0 for j in range(13)] for i in range(len(S) + 1)]
dp[0][0] = 1

for i, s in enumerate(S):
    for j in range(10):
        if s != '?' and s != j:
            continue

        for k in range(13):
            dp[i + 1][(10 * k + j) % 13] += dp[i][k] % x

print(int(dp[-1][5] % x))

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
mod = 10**9+7


dp = [[0]*13 for _ in range(len(s)+1)]
dp[0][0] = 1
mul = 1
s_rev = s[::-1]
for i in range(len(s)):
    x = s_rev[i]
    if x == '?':
        for k in range(10):
            for j in range(13):
                dp[i+1][(mul*k+j)%13] += dp[i][j]
                dp[i+1][(mul*k+j)%13] %= mod
    else:
        k = int(x)
        for j in range(13):
            dp[i+1][(mul*k+j)%13] += dp[i][j]
            dp[i+1][(mul*k+j)%13] %= mod
    mul = mul * 10 % mod

print(dp[len(s)][5] % mod)

Failing test case input:
?6?42???8??29?06233????9??3???7258??5??8??????0774????4?1??17?????5?7????86???

Expected output:
153716844


Actual output:
153719678


Fixed submission (verdict: Accepted):
s = input()
mod = 10**9+7


dp = [[0]*13 for _ in range(len(s)+1)]
dp[0][0] = 1
mul = 1
s_rev = s[::-1]
for i in range(len(s)):
    x = s_rev[i]
    if x == '?':
        for k in range(10):
            for j in range(13):
                dp[i+1][(mul*k+j)%13] += dp[i][j]
                dp[i+1][(mul*k+j)%13] %= mod
    else:
        k = int(x)
        for j in range(13):
            dp[i+1][(mul*k+j)%13] += dp[i][j]
            dp[i+1][(mul*k+j)%13] %= mod
    mul = mul * 10 % 13

print(dp[len(s)][5] % mod)
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()[::-1]
m = 13
mod = 10**9+7

r = [1]
for i in range(10**5):
    r.append(r[-1]*10 % mod)

dp = [0]*m
dp[0] = 1
for i, c in enumerate(s):
    nxt = [0]*m
    if c == "?":
        for j in range(m):
            for k in range(10):
                nxt[(j+k*r[i])%m] += dp[j]
                nxt[(j+k*r[i])%m] %= mod
    else:
        n = int(c)
        for j in range(m):
            nxt[(j+n*r[i])%m] += dp[j]
            nxt[(j+n*r[i])%m] %= mod
    dp = nxt
print(dp[5])



Failing test case input:
?6?42???8??29?06143???19??3???7258??5??7???????774????4?1???8?????6?70???76???

Expected output:
153716875


Actual output:
153699278


Fixed submission (verdict: Accepted):
s = input()[::-1]
m = 13
mod = 10**9+7

r = [1]
for i in range(10**5):
    r.append(r[-1]*10 % m)

dp = [0]*m
dp[0] = 1
for i, c in enumerate(s):
    nxt = [0]*m
    if c == "?":
        for j in range(m):
            for k in range(10):
                nxt[(j+k*r[i])%m] += dp[j]
                nxt[(j+k*r[i])%m] %= mod
    else:
        n = int(c)
        for j in range(m):
            nxt[(j+n*r[i])%m] += dp[j]
            nxt[(j+n*r[i])%m] %= mod
    dp = nxt
print(dp[5])
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())

print(a*b-a-b)




Failing test case input:
-4 -162

Expected output:
815


Actual output:
814


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())

print(a*b-a-b+1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int, input().split())
print(A*B-B-A-1)

Failing test case input:
-1 -21

Expected output:
44


Actual output:
42


Fixed submission (verdict: Accepted):
A,B=map(int, input().split())
print((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import collections
import sys


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

a,b=MI()
ans=a*b-a-b
print(ans)

Failing test case input:
0 -53

Expected output:
54


Actual output:
53


Fixed submission (verdict: Accepted):
import math
import collections
import sys
 

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
 
a,b=MI()
ans=a*b-a-b+1
print(ans)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print((A-1)*(A-1))

Failing test case input:
-22 4

Expected output:
-69


Actual output:
529


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(a * b - a - b -1)

Failing test case input:
-22 4

Expected output:
-69


Actual output:
-71


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
print(a * b - a - b + 1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print (A*B)

Failing test case input:
-2 -105

Expected output:
318


Actual output:
210


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print ((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int,input().split())
print((a-1)*(b-1)+1)

Failing test case input:
-36 13

Expected output:
-444


Actual output:
-443


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B= (int(x) for x in input().split())
menseki=A*B
tate=1*A
yoko=1*B
goukei=1
nyan=menseki-(tate+yoko)+1

Failing test case input:
-33 8

Expected output:
-238


Actual output:

Fixed submission (verdict: Accepted):
A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

Problem: p03280
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B = map(int,input().split())
print((A-1)*(B-1)+1)

Failing test case input:
-2 78

Expected output:
-231


Actual output:
-230


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print((A-1)*(B-1))
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums = [int(i) for i in input().split()] 

print(nums[0] * nums[1])

Failing test case input:
-2 -105

Expected output:
318


Actual output:
210


Fixed submission (verdict: Accepted):
nums = [(int(i) - 1) for i in input().split()] 

print(nums[0] * nums[1])

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int,input().split())
print(str(a * b))

Failing test case input:
-33 13

Expected output:
-408


Actual output:
-429


Fixed submission (verdict: Accepted):
a, b = map(int,input().split())
print(str((a-1) * (b-1)))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
print(a*b-a-b)

Failing test case input:
-7 6

Expected output:
-40


Actual output:
-41


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
print(a*b-a-b)

Failing test case input:
-7 6

Expected output:
-40


Actual output:
-41


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
print(a*b-a-b+1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())

print(a*b-(a-1)*(b-1))

Failing test case input:
-4 -27

Expected output:
140


Actual output:
-32


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())

print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

print(int(A*B-B-A))

Failing test case input:
-1 -38

Expected output:
78


Actual output:
77


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())

print(int(A*B-B-A)+1)

Problem: p03280
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def resolve():
    H, W = map(int, input().split(" "))
    return (H-1)*(W-1)

if '__main__' == __name__:
    resolve()

Failing test case input:
-2 56

Expected output:
-165


Actual output:

Fixed submission (verdict: Accepted):
import sys

def resolve():
    H, W = map(int, input().split(" "))
    print((H-1)*(W-1))

if '__main__' == __name__:
    resolve()

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums = list(map(int, input().split()))
(nums[0]-1)*(nums[1]-1)

Failing test case input:
-4 -27

Expected output:
140


Actual output:

Fixed submission (verdict: Accepted):
nums = list(map(int, input().split()))
print((nums[0]-1)*(nums[1]-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print((A * B) - ((1 * A) + (1 * B)))

Failing test case input:
0 79

Expected output:
-78


Actual output:
-79


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print((A - 1) * (B - 1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())

print(a*b-a-b)

Failing test case input:
-7 6

Expected output:
-40


Actual output:
-41


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())

print(a*b-a-b +1)
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
li = list(map(int,input().split()))
n=li[0]
l=li[1]
print(n*l)

Failing test case input:
6 12

Expected output:
55


Actual output:
72


Fixed submission (verdict: Accepted):
li = list(map(int,input().split()))
n=li[0]
l=li[1]
print((n-1)*(l-1))

Problem: p03280
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math





inputa = input().split()





a = int(inputa[0])
b = int(inputa[1])





print(a * b -a -b -1)

Failing test case input:
-12 -1

Expected output:
26


Actual output:
24


Fixed submission (verdict: Accepted):
import math





inputa = input().split()





a = int(inputa[0])
b = int(inputa[1])





print(a * b -a -b +1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputs=input().split()
A=int(inputs[0])
B=int(inputs[1])
(A-1) * (B-1)

Failing test case input:
-2 78

Expected output:
-231


Actual output:

Fixed submission (verdict: Accepted):
inputs=input().split()
A=int(inputs[0])
B=int(inputs[1])
print((A-1) * (B-1))

Problem: p03280
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print("nyan")

Failing test case input:
0 -33

Expected output:
34


Actual output:
nyan


Fixed submission (verdict: Accepted):
A,B= (int(x) for x in input().split())
menseki=A*B
nyan=menseki-A-B+1
print(nyan)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split());print(a*b-a+b+1)

Failing test case input:
0 -105

Expected output:
106


Actual output:
-104


Fixed submission (verdict: Accepted):
a,b=map(int,input().split());print(a*b-(a+b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
print((a-1)*(b-2))

Failing test case input:
0 52

Expected output:
-51


Actual output:
-50


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=(int(i) for i in input().split())
print(A*B-A-B)

Failing test case input:
0 40

Expected output:
-39


Actual output:
-40


Fixed submission (verdict: Accepted):
A,B=(int(i) for i in input().split())
print(A*B-A-B+1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map (int, input().split())

print(a + b - 1)

Failing test case input:
0 -53

Expected output:
54


Actual output:
-54


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())

print(a * b - (a + b - 1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

print(a * b - a - b - + 1)

Failing test case input:
-1 -24

Expected output:
50


Actual output:
48


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())

print(a * b - a - b + 1)

Problem: p03280
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b = map(int,input().split())
print(a+b-1)

Failing test case input:
-12 -1

Expected output:
26


Actual output:
-14


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
print(a*b - (a+b-1))
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int,input().split()) 
print(A * B)

Failing test case input:
-4 -84

Expected output:
425


Actual output:
336


Fixed submission (verdict: Accepted):
A, B = map(int,input().split()) 
print((A-1) * (B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
c = (a-1) * (b-1)


Failing test case input:
-1 -9

Expected output:
20


Actual output:

Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
c = (a-1) * (b-1)
print(c)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(a * b - a - b)

Failing test case input:
-2 -105

Expected output:
318


Actual output:
317


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
print(a * b - a - b + 1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
print((A*B)-A-B+(A*B))


Failing test case input:
-4 6

Expected output:
-25


Actual output:
-50


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print(int((A*B)-A-B+1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

a,b=map(int,input().split())

s = a*b - a - b
print(s)


Failing test case input:
-1 -21

Expected output:
44


Actual output:
43


Fixed submission (verdict: Accepted):

a,b=map(int,input().split())

s = a * b - a - b + 1
print(s)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a+b-1)

Failing test case input:
0 -53

Expected output:
54


Actual output:
-54


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a*b+1-a-b)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map( int, input().split())

print((A * B) - (A + B))

Failing test case input:
-2 56

Expected output:
-165


Actual output:
-166


Fixed submission (verdict: Accepted):
A, B = map( int, input().split())
 
print((A * B) - (A + B - 1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
source = input().split()
A,B = int(source[0]), int(source[1])
print(A*B-(A+B))

Failing test case input:
6 12

Expected output:
55


Actual output:
54


Fixed submission (verdict: Accepted):
source = input().split()
A, B = int(source[0]), int(source[1])
print(A * B - (A + B - 1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a*b-a-b-1)

Failing test case input:
-33 13

Expected output:
-408


Actual output:
-410


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a*b-a-b+1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
print(A*B-(A+B))

Failing test case input:
-4 -84

Expected output:
425


Actual output:
424


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print(A*B-(A+B)+1)
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=list(map(int,input().split()))
print((A-1)*(B-1) + 1)

Failing test case input:
0 66

Expected output:
-65


Actual output:
-64


Fixed submission (verdict: Accepted):
A,B=list(map(int,input().split()))
print((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(a * b - a + b - 1)

Failing test case input:
-1 17

Expected output:
-32


Actual output:
0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
print(a * b - ( a + b - 1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
print((a-1) * (b-1) + 1)

Failing test case input:
0 79

Expected output:
-78


Actual output:
-77


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
print((a-1) * (b-1) )

Problem: p03280
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int,input().split())
print((a-1)+(b-1))

Failing test case input:
-3 -162

Expected output:
652


Actual output:
-167


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b=map(int, input().split())
print(a*b-a-b-1)

Failing test case input:
0 -33

Expected output:
34


Actual output:
32


Fixed submission (verdict: Accepted):
a, b=map(int, input().split())
print(a*b-a-b+1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = list(map(int,input().split()))
print(A * B - A - B - 1)

Failing test case input:
-4 -162

Expected output:
815


Actual output:
813


Fixed submission (verdict: Accepted):
A, B = list(map(int,input().split()))
print(A * B - A - B + 1)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

c = a - 1
d = b - 1
print(a*b)

Failing test case input:
-33 13

Expected output:
-408


Actual output:
-429


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())

c = a - 1
d = b - 1
print(c*d)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def solve(A, B):
    ans = A * B
    ans -= (A + B) - 1
    return ans

if __name__ == "__main__":

    A, B = map(int, input().split())
    


Failing test case input:
0 40

Expected output:
-39


Actual output:

Fixed submission (verdict: Accepted):


def solve(A, B):
    ans = A * B
    ans -= (A + B) - 1
    return ans

if __name__ == "__main__":

    A, B = map(int, input().split())
    print(solve(A, B))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

print(a*b - a - b + a)

Failing test case input:
-36 13

Expected output:
-444


Actual output:
-481


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())

print(a*b - a - b + 1)
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def Garden(a , b):

    return a * b - a + b + 1

def main():
    a , b = map(int , input().split())
    print(Garden(a , b))

if __name__ == '__main__':
    main()

Failing test case input:
0 -33

Expected output:
34


Actual output:
-32


Fixed submission (verdict: Accepted):
def Garden(a , b):

    return a * b - (a + b) + 1

def main():
    a , b = map(int , input().split())
    print(Garden(a , b))

if __name__ == '__main__':
    main()

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(a*b)

Failing test case input:
-2 30

Expected output:
-87


Actual output:
-60


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
print((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

print((A - 1) * (A - 1))


Failing test case input:
-4 -27

Expected output:
140


Actual output:
25


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())

print((A - 1) * (B - 1))

Problem: p03280
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b = map(int, input ().split ())
print ((a-1)*(b-1)+1)

Failing test case input:
-4 -27

Expected output:
140


Actual output:
141


Fixed submission (verdict: Accepted):
a,b = map(int, input ().split ())
print ((a-1)*(b-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = input().split(' ')
A=int(A)
B=int(B)
print(A * B)

Failing test case input:
-3 -162

Expected output:
652


Actual output:
486


Fixed submission (verdict: Accepted):
A,B = input().split(' ')
A=int(A)-1
B=int(B)-1
print(A * B)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int,input().split())
print(A-1 * B-1)

Failing test case input:
-33 13

Expected output:
-408


Actual output:
-47


Fixed submission (verdict: Accepted):
A, B = map(int,input().split())
print((A-1) * (B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
print(A*B-(A+B))

Failing test case input:
-36 13

Expected output:
-444


Actual output:
-445


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
print(int(A*B - (A+B)))

Failing test case input:
-2 -162

Expected output:
489


Actual output:
488


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print(int(A*B - (A+B-1)))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a+b-a*b)


Failing test case input:
-2 30

Expected output:
-87


Actual output:
88


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a*b+1-a-b)

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
c=(a-1)*(b-1)
c

Failing test case input:
-33 8

Expected output:
-238


Actual output:

Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
c=(a-1)*(b-1)
print(c)
Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print(A*B)

Failing test case input:
-2 56

Expected output:
-165


Actual output:
-112


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print((A-1)*(B-1))

Problem: p03280
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(a*b - a*1 + b*1)

Failing test case input:
-21 4

Expected output:
-66


Actual output:
-59


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
print(A*B-(A*1+B*1)+1)
Problem: p00387
Buggy submission (Python3, verdict: Wrong Answer):
A, B = map(int, input().split())
print((B+A-1)/A)



Failing test case input:
25 10

Expected output:
1

Actual output:
1.36


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print((B+A-1)
Problem: p03409
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
R = [list(map(int,input().split())) for i in range(N)]
B = [list(map(int,input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse=False)
B.sort(key = lambda x:x[0], reverse=False)
ans = 0
for b in B:
    for r in R:
        if r[0] < b[0] and r[1] < b[1]:
            ans += 1
            R.remove(r)
            break
print(ans)

Failing test case input:
5
-1 0
7 1
2 2
4 8
1 6
8 5
6 9
5 4
9 1
2 7

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
R = [list(map(int,input().split())) for i in range(N)]
B = [list(map(int,input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse=True)
B.sort(key = lambda x:x[0], reverse=False)
ans = 0
for b in B:
    for r in R:
        if r[0] < b[0] and r[1] < b[1]:
            ans += 1
            R.remove(r)
            break
print(ans)

Problem: p03409
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
red=[tuple(map(int,input().split())) for _ in range(N)]
blue=[tuple(map(int,input().split())) for _ in range(N)]

blue=sorted(blue, key=lambda x: x[0])

ans=0
for b in blue:
    candi=[i for i in red if i[0]<b[0]]
    if candi:
        red.remove(sorted(candi, key=lambda x: x[1], reverse=True)[0])
        ans+=1

print(ans)

Failing test case input:
5
0 0
4 1
5 0
6 6
13 11
2 2
8 3
-1 4
8 4
9 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())
red=[tuple(map(int,input().split())) for _ in range(N)]
blue=[tuple(map(int,input().split())) for _ in range(N)]

blue=sorted(blue, key=lambda x: x[0])

ans=0

for b in blue:
    candi=[i for i in red if i[0]<b[0] and i[1]<b[1]]
    if candi:
        red.remove(sorted(candi, key=lambda x: x[1], reverse=True)[0])
        ans+=1

print(ans)

Problem: p03409
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(N)]
ab.sort()
cd.sort(reverse=True)
count=0
for i in range(N):
    cdlen = len(cd)
    j=0
    for j in range(cdlen):
        if ab[i][0]<cd[j][0] and ab[i][1]<cd[j][1]:
            count+=1
            del cd[j]
            break
print(count)

Failing test case input:
5
0 0
7 3
2 2
4 8
1 6
8 5
9 9
5 4
11 1
2 7

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
from operator import itemgetter
N = int(input())
red = [list(map(int,input().split())) for i in range(N)]
blue = [list(map(int,input().split())) for i in range(N)]
blue.sort()
red2=sorted(red,key=itemgetter(1))
red3=[]
for x in red2[::-1]:
  red3.append(x)
count=0
for i in range(N):
  redlen=len(red3)
  j=0
  for j in range(redlen):
    if red3[j][0]<blue[i][0] and red3[j][1]<blue[i][1]:
      count+=1
      del red3[j]
      break
print(count)