ZhenlongDai/ACPR huggingface dataset:
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("No")

Failing test case input:
1 3 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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


if b - a == c - b:
    print('Yes')
else:
    print('No')

Failing test case input:
1 3 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):

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


if b - a == c - b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if b - a == c - b:
    print('Yes')
else:
    print('No')

Failing test case input:
2 4 6

Expected output:
YES

Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print("Yes"if b-a==c-b else"No")

Failing test case input:
-1 -3 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print("YES"if b-a==c-b else"NO")

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


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

if abs(a-b) == abs(b-c):
    print('YES')
else:
    print('NO')


Failing test case input:
1 -2 1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):


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

if b-a == c-b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = [int(n) for n in input().split()]
print('YES' if abs(A - B) == abs(C - B) else 'NO')

Failing test case input:
-1 -3 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
A, B, C = [int(n) for n in input().split()]
print('YES' if B * 2 == A + C else 'NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l=input().split()
a,b,c=int(l[0]),int(l[1]),int(l[2])
if a-b==b-c:
    print("Yes")
else:
    print("No")


Failing test case input:
0 2 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
l=input().split()
a,b,c=int(l[0]),int(l[1]),int(l[2])
if a-b==b-c:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split());print("YNEOS"[b*2-a-c>0::2])

Failing test case input:
-1 -3 0

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split());print("YNEOS"[b*2-a-c!=0::2])
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = [int(i) for i in input().split()]

if (b-a) == (c-b):
    print("Yes")
else:
    print("No")

Failing test case input:
2 4 6

Expected output:
YES

Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = [int(i) for i in input().split()]

if (b-a) == (c-b):
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(a,b,c)
if b-a==c-b:
    print("YES")
else:
    print("NO")


Failing test case input:
4 -2 -6

Expected output:
NO


Actual output:
4 -2 -6
NO


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print("Yes" if b - a == c - b else "No")

Failing test case input:
0 -2 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print("YES" if b - a == c - b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(["No","Yes"][a+c==b*2])


Failing test case input:
2 0 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(["NO","YES"][a-b==b-c])

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int, input().split())
if b-a==c-b:
  print("TES")
else:
  print("NO")

Failing test case input:
3 2 1

Expected output:
YES

Actual output:
TES


Fixed submission (verdict: Accepted):
a,b,c=map(int, input().split())
if b-a==c-b:
  print("YES")
else:
  print("NO")

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

if abs(a[0] - a[1]) == abs(a[1] - a[2]):
    print("YES")
else:
    print("NO")

Failing test case input:
-2 -3 -2

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
x = list(map(int, input().split()))

if (x[1] - x[0]) == (x[2] - x[1]):
    print("YES")
else:
    print("NO")

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

a,b,c = map(int,input().split())
print('Yes' if b-a==c-b else 'No')

Failing test case input:
0 3 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):

a,b,c = map(int,input().split())
print('YES' if b-a==c-b else 'NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c =map(int,input().split())
if b-a == c-b:
    print("Yes")
else:
    print("No")


Failing test case input:
1 -1 2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c =map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())

if b - a == c - b:
    print("Yes")
else:
    print("No")

Failing test case input:
2 -1 -1

Expected output:
NO


Actual output:
No


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

if b - a == c - b:
    print("YES")
else:
    print("NO")

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

if (b-a)==(c-b):
    print("YES")
else:
    print("No")


Failing test case input:
-1 -1 0

Expected output:
NO


Actual output:
No


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

if (b-a)==(c-b):
    print("YES")
else:
    print("NO")

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

if b-a == c-b:
  print('YES')
else:
  print('No')

Failing test case input:
2 8 6

Expected output:
NO


Actual output:
No


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

if b-a == c-b:
  print('YES')
else:
  print('NO')

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())

if b - a == c - b:
    print("Yes")
else:
    print("No")



Failing test case input:
1 -1 2

Expected output:
NO


Actual output:
No


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

if b - a == c - b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if abs(a-b)==abs(c-b):
    print('YES')
else:
    print('NO')

Failing test case input:
-1 -6 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if b-a==c-b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if b-a == c-a:
    print('YES')
else:
    print('NO')
    

Failing test case input:
-2 -1 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if b-a == c-b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print('Yes' if b - a == c - a else 'No')

Failing test case input:
3 2 1

Expected output:
YES

Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print('YES' if (b - a) == (c - b) else 'NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int, input().split())
if b-c == c-a:
  print("YES")
else:
  print("NO")

Failing test case input:
1 3 2

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int, input().split())
if b-a == c-b:
  print("YES")
else:
  print("NO")
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if b - a == c - b:
    print("Yes")
else:
    print("No")


Failing test case input:
1 0 -1

Expected output:
YES


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if b - a == c - b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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


if b - a == b - c:
    print("YES")
else:
    print("NO")

Failing test case input:
-1 -3 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):

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


if b - a == c - b:
    print("YES")
else:
    print("NO")

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

if b-a == c-b:
    print('Yes')
else:
    print('No')

Failing test case input:
4 -2 -6

Expected output:
NO


Actual output:
No


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

if b-a == c-b:
    print('YES')
else:
    print('NO')

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

if (b-a) == (c-a):
    print('YES')
else:
    print('NO')

Failing test case input:
2 -1 -1

Expected output:
NO


Actual output:
YES


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

if (b-a) == (c-b):
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
print("Yes" if b-a==c-b else "No")

Failing test case input:
1 1 -4

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
print("YES" if b-a==c-b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if a - b == c - b:
    print('YES')
else:
    print('NO')


Failing test case input:
1 10 1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print('Yes' if (b - a) == (c - b) else 'No')

Failing test case input:
3 -2 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print('YES' if (b - a) == (c - b) else 'NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = list(map(int, input().split()))
print('YES' if b-a == c-b else 'No')

Failing test case input:
0 -2 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = list(map(int, input().split()))
print('YES' if b-a == c-b else 'NO')
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if b - a == c - b:
    print('Yes')
else:
    print('No')


Failing test case input:
-2 -2 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=map(int,input().split())

if b - a == c - b:
    print('YES')
else:
    print('No')

Failing test case input:
4 -2 -3

Expected output:
NO


Actual output:
No


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

if b - a == c - b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if a - b == c - b:
  print("YES")
else:
  print("NO")

Failing test case input:
2 4 6

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b:
  print("YES")
else:
  print("NO")

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

if b - a == c - b:
    print('Yes')
else:
    print('No')

Failing test case input:
0 -3 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b :
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print("YES" if abs(a-b) == abs(c-b) else "NO")

Failing test case input:
1 10 1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print("YES" if b-a == c-b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if abs(int(b-a))==abs(int(c-b)):
  print('YES')
else:
  print('NO')


Failing test case input:
-2 -3 -2

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if b-a==c-b:
  print('YES')
else:
  print('NO')

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = list(map(int, input().split()))
print("Yes" if b-a == c-b else "No")

Failing test case input:
4 -1 -1

Expected output:
NO


Actual output:
No


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

print("YES" if b - a == c - b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if abs(a-b)==abs(b-c):
    print("YES")
else:
    print("NO")

Failing test case input:
-1 -6 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if (b - a == c - b):
    print("Yes")
else:
    print("No")

Failing test case input:
-1 -1 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if (b - a == c - b):
    print("YES")
else:
    print("NO")

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

if b-a == b-c:
    print('Yes')
else:
    print('No')

Failing test case input:
-2 -1 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b - a == c - b :
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int, input().split())
print("YES" if abs(a-b)==abs(b-c) else "NO")

Failing test case input:
0 -3 0

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int, input().split())
print("YES" if a-b==b-c else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
print("Yes" if b-a == c-b else "No")

Failing test case input:
2 1 0

Expected output:
YES


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
print("YES" if b-a == c-b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    a,b,c = map(int, input().split())
    if b - a == c - b:
        print('Yes')
    else:
        print('No')
main()


Failing test case input:
-2 -3 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    a,b,c = map(int, input().split())
    if b - a == c - b:
        print('YES')
    else:
        print('NO')
main()

Problem: p03759
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a, b, c = map(int, input().split())

print("YES" if abs(b-a) == abs(c-b) else "NO")

Failing test case input:
-1 -3 -1

Expected output:
NO


Actual output:
YES


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

print("YES" if b-a == c-b else "NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=map(int, input().split())
if b-a == c-b:
    print("Yes")
else:
    print("No")

Failing test case input:
-2 -3 0

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c=map(int, input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if abs(a-b) == abs(b-c):
  print('YES')
else:
  print('NO')

Failing test case input:
-1 -6 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b-a == c-b:
  print('YES')
else:
  print('NO')
Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    a, b, c = map(int, input().split())
    if b - a == c - b:
        print('YES')
    else:
        print('No')


if __name__ == '__main__':
    main()


Failing test case input:
0 -2 -2

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    a, b, c = map(int, input().split())
    if b - a == c - b:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


def main():
    a, b, c = map(int, input().split())
    print("YES" if b - a == c - a else "NO")


if __name__ == "__main__":
    main()


Failing test case input:
3 2 1

Expected output:
YES

Actual output:
NO


Fixed submission (verdict: Accepted):


def main():
    a, b, c = map(int, input().split())
    print("YES" if b - a == c - b else "NO")


if __name__ == "__main__":
    main()

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print("Yes" if b-a==c-b else "No")

Failing test case input:
3 -2 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print("YES" if b-a==c-b else "NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
print (a,b,c)
print("Yes" if b-a == c-b else "No")

Failing test case input:
2 8 6

Expected output:
NO


Actual output:
2 8 6
No


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

print("YES" if b - a == c - b else "NO")

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

if b-a == c-b:
    print("Yes")
else:
    print("No")

Failing test case input:
-2 -3 -1

Expected output:
NO


Actual output:
No


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

if b-a == c-b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print("Yes" if b-a==c-b else "No")

Failing test case input:
-1 -2 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print("YES" if b-a==c-b else "NO")

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c= map(int, input().split())

ba = b - a
cb = c - b

if ba == cb:
    print("Yes")
else:
    print("No")

Failing test case input:
-2 -2 -1

Expected output:
NO


Actual output:
No


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

if b - a == c - b:
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if b-a == c-b:
    print("Yes")
else:
    print("No")

Failing test case input:
-2 -3 -4

Expected output:
YES


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a , b , c = map(int,input().split())
if b - a == c - b:
  print("Yes")
else: 
  print("No")

Failing test case input:
1 1 -5

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a , b , c = map(int,input().split())
if b - a == c - b:
  print("YES")
else: 
  print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print("Yes" if abs(a-b) == abs(c-b) else "No")

Failing test case input:
-1 -6 -1

Expected output:
NO


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print("YES" if b-a == c-b else "NO")

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

if b - a == c - a:
  print("YES")
else:
  print("NO")

Failing test case input:
4 -2 -2

Expected output:
NO


Actual output:
YES


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

if b - a == c - b:
  print("YES")
else:
  print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if b-c == c-a:
    print('Yes')
else:
    print('No')


Failing test case input:
-1 -2 -1

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if b-a == c-b:
    print('YES')
else:
    print('NO')

Problem: p03759
Buggy submission (Python (3.8.2), verdict: Wrong Answer):








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



if abs(b - a) == abs(c - b):
    print("YES")
else:
    print("NO")


Failing test case input:
1 10 1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):








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



if (b - a) == (c - b):
    print("YES")
else:
    print("NO")

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print("YNEOS"[abs(a-b)!=abs(b-c)::2])

Failing test case input:
0 -3 0

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print("YNEOS"[a-b!=b-c::2])

Problem: p03759
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print(["NO","YES"][abs(b-a) == abs(c-b)])

Failing test case input:
-1 -3 -1

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print(["NO","YES"][b-a == c-b])

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

from collections import Counter

a,b,c = map(int,input().split())
if(abs(b-a)==abs(c-b)):
    print("YES")
else:
    print("NO")

Failing test case input:
2 4 2

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):

from collections import Counter

a,b,c = map(int,input().split())
if(b-a ==  c-b):
    print("YES")
else:
    print("NO")
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

MOD = 10**9+7

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


dp[0][0] = 1



for index in range(1, len(S) + 1):
    s = S[len(S) - index ]
    if s == '?':
   	 for i in range(10):
            for pre_index in range(13):
                next_i = (i   +  pre_index * 10 ) % 13
                dp[index][next_i] += dp[index - 1][pre_index] % MOD
    else:
        i = int(s)
        for pre_index in range(13):
            next_i = (i +  pre_index * 10 ) % 13
            dp[index][next_i] += dp[index - 1][pre_index] % MOD




print(dp[len(S)][5] % MOD)



Failing test case input:
84?

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
 
MOD = 10**9+7
 
dp = [[0]*13 for _ in range(len(S) + 1)]
 
 
dp[0][0] = 1
 
for index in range(len(S)):
    if S[index] == '?':
        for pre_index in range(13):
            for i in range(10):
                next_i = (i +  pre_index * 10 ) % 13
                dp[index+1][next_i] += dp[index][pre_index] 
                dp[index+1][next_i] %= MOD

    else:
        for pre_index in range(13):
            i = int(S[index])
            next_i = (i +  pre_index  * 10) % 13
            dp[index+1][next_i] += dp[index][pre_index] 
            dp[index+1][next_i] %= MOD
 
 
 
print(dp[len(S)][5])

Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
q = s.count("?")
ans = [0] * 13
ans[0] = 1

for v in s:
    dp = [0] * 13
    for j in range(13):
        dp[(j * 10) % 13] = ans[j] % 1000000007
    dp += dp
    for j in range(13):
        if v == '?':
            ans[j] = sum(dp[j+4:j+14])
        else:
            ans[j] = dp[(j + int(v)) % 13]

print(ans[5] % 1000000007)

Failing test case input:
8?4

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
q = s.count("?")
ans = [0] * 13
ans[0] = 1

for v in s:
    dp = [0] * 13
    for j in range(13):
        dp[(j * 10) % 13] = ans[j] % 1000000007
    dp += dp
    for j in range(13):
        if v == '?':
            ans[j] = sum(dp[j+4:j+14])
        else:
            ans[j] = dp[j - int(v)]

print(ans[5] % 1000000007)
Problem: p02960
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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])

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

Expected output:
153717912


Actual output:
6153717954


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):
N=input()

lists = []
temp=[i for i in range(10)]

dic={0:1}

for i in N:
    new_dic={}
    if i == "?":
        for amari,count in list(dic.items()):
            for num in temp:
                a = (amari*10 + num) % 13
                new_dic[a]=count
    else:
        num=int(i)
        for amari,count in list(dic.items()):
            a = (amari*10 + num)%13
            if a in new_dic:
                new_dic[a]+=count
            else:
                new_dic[a]=count
    dic = new_dic

try:
    print(dic[5]%(10**9 + 7))
except:
    print(0)

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

Expected output:
153716660


Actual output:
1


Fixed submission (verdict: Accepted):

N=input()

lists = []
temp=[i for i in range(10)]

MOD=10**9+7

dic={0:1}

for i in N:
    new_dic={}
    hoge=list(dic.items())
    if i == "?":
        for amari,count in hoge:
            amari*=10
            for num in temp:
                a = (amari + num) % 13
                if a in new_dic:
                    new_dic[a]+=count
                else:
                    new_dic[a]=count
    else:
        num=int(i)
        for amari,count in hoge:
            a = (amari*10 + num)%13
            if a in new_dic:
                new_dic[a]+=count
            else:
                new_dic[a]=count
    for key in new_dic:
        new_dic[key] %= MOD
    dic = new_dic

try:
    print(dic[5])
except:
    print(0)
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S=input()
N=len(S)
mod=13
mod2=10**9+7
pow10=1


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

dp[0][0]=1

for i in range(N):
    pow10*=10
    if S[-i-1]!="?":
        a=(pow10*int(S[-i-1]))%mod
        for j in range(mod):
            dp[i+1][(j+a)%mod]=dp[i][j]
    else:
        a=pow10%mod
        for j in range(mod):
            for k in range(10):
                dp[i+1][(j+k*a)%mod]+=dp[i][j]
                dp[i+1][(j+k*a)%mod]%=mod2

print(dp[-1][5])

Failing test case input:
7?4

Expected output:
0

Actual output:
1


Fixed submission (verdict: Accepted):
S=input()
N=len(S)
mod=13
mod2=10**9+7


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

dp[0][0]=1

for i in range(N):
    if S[i]!="?":
        for j in range(mod):
            dp[i+1][(10*j+int(S[i]))%mod]=dp[i][j]
    else:
        for j in range(mod):
            for k in range(10):
                dp[i+1][(10*j+k)%mod]+=dp[i][j]%mod2

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

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

dp=[[0 for j in range(13)] for i in range(l+1)]
dp[0][0]=1
for i in range(l):
    if s[i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(k*10+j)%13] += dp[i][k]%mod
    else:
        for k in range(13):
            dp[i+1][(k*10+int(s[i]))%13]+=dp[i][k]%mod
print(dp[-1][5])

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

Expected output:
153716863


Actual output:
6153716905


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

dp=[[0 for j in range(13)] for i in range(l+1)]
dp[0][0]=1
for i in range(l):
    if s[i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(k*10+j)%13] += dp[i][k]%mod
    else:
        for k in range(13):
            dp[i+1][(k*10+int(s[i]))%13]+=dp[i][k]%mod
print(dp[-1][5]%mod)

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] != "?":
        mod = int(s[i]) * 10 ** (n - 1 - i) % MOD
        mod = mod % 13
        for j in range(13):
            dp[i + 1][j] =dp[i+1][j] + dp[i][(j - mod) % 13] % MOD
    else:
        for k in range(10):
            mod = k*10**(n-1-i) % MOD

            mod = mod % 13
            for j in range(13):
                dp[i+1][j] = dp[i+1][j] + dp[i][(j+mod) % 13] % MOD
print(dp[n][5])

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

Expected output:
153716835


Actual output:
6254132484


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):
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):
            dp[i + 1][(k * 10 + j) % 13] += dp[i][k]

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


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

Expected output:
153716889


Actual output:
266898653875313815870865217905634074


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):
rotate = lambda x,y: x[-y:] + x[:-y]
S = input()
S = "??2??5"
mod = 13
amari = 5
dp_tmp = [0]*13
dp_tmp[0] = 1
mul = 1
for s in S[::-1]:
    dp = [0]*13
    if s == "?":
        for n in range(10):
            dp_tmp_roll = rotate(dp_tmp,n*mul%mod)
            for k in range(13):
                dp[k] += dp_tmp_roll[k]
    else:
        dp_tmp_roll = rotate(dp_tmp,int(s)*mul%mod)
        for k in range(13):
            dp[k] += dp_tmp_roll[k]
    for n in range(13):
        dp[n] = dp[n]%(10**9+7)
    dp_tmp = dp
    mul = mul*10%13
print(dp[amari])


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:
768


Fixed submission (verdict: Accepted):
rotate = lambda x,y: x[-y:] + x[:-y]
S = input()
mod = 13
amari = 5
dp_tmp = [0]*13
dp_tmp[0] = 1
mul = 1
for s in S[::-1]:
    dp = [0]*13
    if s == "?":
        for n in range(10):
            dp_tmp_roll = rotate(dp_tmp,n*mul%mod)
            for k in range(13):
                dp[k] += dp_tmp_roll[k]
    else:
        dp_tmp_roll = rotate(dp_tmp,int(s)*mul%mod)
        for k in range(13):
            dp[k] += dp_tmp_roll[k]
    for n in range(13):
        dp[n] = dp[n]%(10**9+7)
    dp_tmp = dp
    mul = mul*10%13
print(dp[amari])
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    s=input()
    n=len(s)
    mod=10**9+7
    
    if s[-1]=="?":
        dp=[1,1,1,1,1,1,1,1,1,1,0,0,0]
    else:
        dp=[0]*13
        dp[int(s[-1])]=1
    
    for i in range(1,n):
        imod=10**(i %13)
        ss0=s[n-i-1]
        if ss0!="?":
            dpnew = [ dp[(j-int(ss0)*imod)%13] %mod for j in range(13)]
        else:
            dpnew = [sum( dp[(j-k*imod)%13] for k in range(10)) %mod for j in range(13) ]
        dp=dpnew[:]
    print(dp[5])
    
if __name__ == '__main__':
    main()

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

Expected output:
153716963


Actual output:
153716914


Fixed submission (verdict: Accepted):

def main():
    s=input()
    n=len(s)
    mod=10**9+7
    
    if s[-1]=="?":
        dp=[1,1,1,1,1,1,1,1,1,1,0,0,0]
    else:
        dp=[0]*13
        dp[int(s[-1])]=1
    
    for i in range(1,n):
        imod=10**(i %12)
        ss0=s[n-i-1]
        if ss0!="?":
            dpnew = [ dp[(j-int(ss0)*imod)%13] %mod for j in range(13)]
        else:
            dpnew = [sum( dp[(j-k*imod)%13] for k in range(10)) %mod for j in range(13) ]
        dp=dpnew[:]
    print(dp[5])
    
if __name__ == '__main__':
    main()

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def find(S):
    MOD=10**9+7
    S=S[::-1]
    dp=[[0]*13 for i in range(len(S))]
    power=1
    if S[0]=="?":
        for i in range(10):
            dp[0][i]=1
    else:
        dp[0][int(S[0])]=1
    
    for i in range(1,len(S)):
        power*=10
        power%=13
        if S[i]=="?":
            for j in range(13):
                for k in range(10):
                    dp[i][j]+=dp[i-1][(j-power*k)%13]
                    dp[i][j]%=MOD
        else:
            for j in range(13):
                k=int(S[i])
                dp[i][j]+=dp[i-1][(j-power*k)%13]
                dp[i][j]%=MOD              
    return dp[-1][5]

Failing test case input:
6?4

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
def find(S):
    MOD=10**9+7
    S=S[::-1]
    dp=[[0]*13 for i in range(len(S))]
    power=1
    if S[0]=="?":
        for i in range(10):
            dp[0][i]=1
    else:
        dp[0][int(S[0])]=1
    
    for i in range(1,len(S)):
        power*=10
        power%=13
        if S[i]=="?":
            for j in range(13):
                for k in range(10):
                    dp[i][j]+=dp[i-1][(j-power*k)%13]
                    dp[i][j]%=MOD
        else:
            for j in range(13):
                k=int(S[i])
                dp[i][j]+=dp[i-1][(j-power*k)%13]
                dp[i][j]%=MOD              
    return dp[-1][5]

S=input()
print(find(S))
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

S = list(input())
length=len(S)
dp = [[0]*13 for _ in range(length)]
dp[0][0]=1
mul = 1
for i in range(length-1):
    if S[length-i-2] == "?":
        for k in range(10):
            for j in range(13):
                j_sub = j-k*mul%13
                if j_sub < 0: j_sub+= 13
                dp[i+1][j]+=dp[i][j_sub]
    else:
        for j in range(13):
            j_sub = j-int(S[length-i-2])*mul%13
            if j_sub < 0: j_sub+= 13
            dp[i+1][j]+=dp[i][j_sub]
    mul=mul*10
print(dp[length-1][5]%1000000007)
print("dammy")

Failing test case input:
?73

Expected output:
1


Actual output:
1
dammy


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
def main():  
    S = list(input())
    S.pop()
    length=len(S)
    dp = [0]*13
    dp[0]=1
    mul=1
    mod=1000000007
    for i in range(1,length+1):
        next_dp = [0]*13
        for j in range(13):
            if S[length-i] == "?":
                for k in range(10):
                    j_sub=(j+k*mul)%13
                    next_dp[j_sub]+=dp[j]
                    next_dp[j_sub]%=mod
            else:
                j_sub=(j+int(S[length-i])*mul)%13
                next_dp[j_sub]+=dp[j]
                next_dp[j_sub]%=mod
        dp=next_dp
        mul=mul*10%13
    print(dp[5]%1000000007)
if __name__ == "__main__":
    main()

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
l=len(s)

dp=[[0 for j in range(13)] for i in range(l+1)]
dp[0][0]=1
place=10

for i in range(l):
    st = s[-(i+1)]
    if st =='?':
        for j in range(10):
            for k in range(13):
                dp[i+1][(k*place+j)%13] += dp[i][k]
    else:
        for k in range(13):
            dp[i+1][(k*place+int(st))%13] += dp[i][k]

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

Failing test case input:
?48

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
s=input()
l=len(s)
 
dp=[[0 for j in range(13)] for i in range(l+1)]
dp[0][0]=1
 
for i in range(l):
    st = s[i]
    if st =='?':
        for j in range(10):
            for k in range(13):
                dp[i+1][(10*k+j)%13] += dp[i][k]
                dp[i+1][(10*k*+j)%13] %= 10**9+7
    else:
        for k in range(13):
            dp[i+1][(10*k+int(st))%13] += dp[i][k]
            dp[i+1][(10*k*+int(st))%13] %= 10**9+7
 
print(dp[l][5]%(10**9+7))
Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
INF = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(len(S) + 1)]
index = 1
dp[0][0] = 1
for i in range(len(S)):
    c = S[-i - 1]
    if c == '?':
        for j in range(10):
            for k in range(13):
                dp[i + 1][(j * index + k) % 13] += dp[i][k]
                dp[i + 1][(j * index + k) % 13] %= INF
    else:
        c = int(c)
        for k in range(13):
            dp[i + 1][(c * index + k) % 13] += dp[i][k]
            dp[i + 1][(c * index + k) % 13] %= INF
    index *= 10
    index %= INF

print(dp[len(S)][5])

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

Expected output:
153716768


Actual output:
154409178


Fixed submission (verdict: Accepted):
S = input()
INF = 10 ** 9 + 7

dp = [[0 for _ in range(13)] for _ in range(len(S) + 1)]
index = 1
dp[0][0] = 1
for i in range(len(S)):
    c = S[-i - 1]
    if c == '?':
        for j in range(10):
            for k in range(13):
                dp[i + 1][(j * index + k) % 13] += dp[i][k]
                dp[i + 1][(j * index + k) % 13] %= INF
    else:
        c = int(c)
        for k in range(13):
            dp[i + 1][(c * index + k) % 13] += dp[i][k]
            dp[i + 1][(c * index + k) % 13] %= INF
    index *= 10
    index %= 13

print(dp[len(S)][5])

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] != "?":
        mod = int(s[i]) % 13
        for j in range(13):
            dp[i+1][(10*j + mod) % 13] = dp[i+1][(10*j+mod) % 13] + dp[i][j] % MOD
    else:
        for k in range(10):
            mod = k % 13
            for j in range(13):
                dp[i+1][(10*j+mod) % 13] = dp[i+1][(10*j+mod) % 13] + dp[i][j] % MOD
print(dp[n][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):
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):
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] != "?":
        mod = int(s[i]) * 10 ** (n - 1 - i) % MOD
        mod = mod % 13
        for j in range(13):
            dp[i + 1][j] = dp[i+1][j] + dp[i][(j - mod) % 13] % MOD
    else:
        for k in range(10):
            mod = k*10**(n-1-i) % MOD
            mod = mod % 13
            for j in range(13):
                dp[i+1][j] = dp[i+1][j] + dp[i][(j - mod) % 13] % MOD
print(dp[n][5])

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:
3846473791


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):
import math
S=input()
dp=[0]*13
nextDp=[0]*13
dp[0]=1

mod = 1000000007
for i in range(len(S)):
    if S[i] == "?":
        for j in range(13):
            for k in range(10):
                nextDp[(10*j + k) % 13] += dp[k]
                nextDp[(10*j + k) % 13] %= mod
    else:
        k = int(S[i])
        for j in range(13):
            nextDp[(10 * j + k) % 13] += dp[k]
            nextDp[(10 * j + k) % 13] %= mod
    for j in range(13):
        dp[j] = nextDp[j]

print(dp[5])


Failing test case input:
???68????7?5?????71??1?4????5770??????8??5??9527???3??9????33260?92??8???24?6?

Expected output:
153716874


Actual output:
977981127


Fixed submission (verdict: Accepted):
import math
S=input()
dp=[0]*13
dp[0]=1

mod = 1000000007

for i in range(len(S)):
    nextDp=[0]*13
    if S[i] == "?":
        for j in range(13):
            for k in range(10):
                nextDp[((10*j) + k) % 13] += dp[j]
                nextDp[((10*j) + k) % 13] %= mod
    else:
        k = int(S[i])
        for j in range(13):
            nextDp[((10*j) + k) % 13] += dp[j]
            nextDp[((10*j) + k) % 13] %= mod
    for j in range(13):
        dp[j] = nextDp[j]

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

S = input()
L = len(S)
memo = [[0 for i in range(14)] for j in range(L + 1)]
dp = [[0 for i in range(14)] for j in range(L + 1)]

dp[0][0] = 1

for k in range(L):
    for m in range(13):
        if S[k] == '?':
            for i in range(10):
                dp[k + 1][(m * 10 + i) % 13] += dp[k][m]
        else:
            dp[k + 1][(m * 10 + int(S[k])) % 13] += dp[k][m]

        for i in range(13):
            dp[k][m] %= MOD

print(dp[L][5])


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:
7692307692307692307692307692307692307692307666


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

S = input()
L = len(S)
memo = [[0 for i in range(14)] for j in range(L + 1)]
dp = [[0 for i in range(14)] for j in range(L + 1)]

dp[0][0] = 1

for k in range(L):
    for m in range(13):
        if S[k] == '?':
            for i in range(10):
                dp[k + 1][(m * 10 + i) % 13] += dp[k][m]
        else:
            dp[k + 1][(m * 10 + int(S[k])) % 13] += dp[k][m]

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

print(dp[L][5])

Problem: p02960
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def update(i, j, mul):
    global dp, dpi, N, MOD



S = "?"*(10**4)

MOD=(10**9) + 7
N=13

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

dpi = 1
mul = 1

for c in S[::-1]:    
    for i in range(N):
        if c=='?':
            for j in range(10):
                ii = (i + (j*mul)) % N
                dp[dpi][ii] += dp[dpi-1][i] % MOD
                
        else:
            j = int(c)
            ii = (i + (j*mul)) % N
            dp[dpi][ii] += dp[dpi-1][i] % MOD
            
    mul *= 10
    mul %= N
    dpi += 1

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

Failing test case input:
6?6

Expected output:
1


Actual output:
221582413


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

MOD=(10**9) + 7
N=13

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

dpi = 1
mul = 1

for c in S[::-1]:    
    for i in range(N):
        if c=='?':
            for j in range(10):
                ii = (i + (j*mul)) % N
                dp[dpi][ii] += dp[dpi-1][i] % MOD
                
        else:
            j = int(c)
            ii = (i + (j*mul)) % N
            dp[dpi][ii] += dp[dpi-1][i] % MOD
            
    mul *= 10
    mul %= N
    dpi += 1

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