Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
m,n = input().split()
print(int(Decimal(m)*Decimal(n)))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
m,n = map(eval,input().split())
print(Decimal(m)*Decimal(b))
Problem p02695 (python)

Fixed submission:
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in L:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))

Buggy submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in l:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))

Buggy submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([i for i in range(1,M+1)], N)
count = []
for a in A:
    temp = 0
    for l in l:
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            temp += l[3]
    count.append(temp)
print(max(count))
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())
a = []
b = []
if M == 0:
    for i in range(1,(2*N)+1):
        if i%2==0 and i>0:
            a.append(i)
elif N == 0:
    for i in range(1,(2*M)+1):
        if i%2==1:
            b.append(i)
else:
    for i in range(1,501):
        if i%2==0 and i>0:
            a.append(i)
        else:
            b.append(i)
c = a[:N] + b[:M]
l = []
num = 1
for i in range(len(c)-1):
    for j in range(num,len(c)):
        res = c[i] + c[j]
        l.append(res)
    num+=1

k=[i for i in l if i%2==0]
print(len(k))

Buggy submission (verdict: Runtime Error):
S = int(input())
a = S//3
b = a * 0.8
c = a * 1.2
ans = a * b * c
ans = ans * 1.0416666666666666
print("{0:.7f}".format(ans))
Problem p02771 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A == B and A == C:
    print("No")
elif A == B or A == C or B == C:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

ans = all(a%3==0 or a%5==0 for a in A if a%2==0)
if ans:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input())
n = list(map(int, input().split()))

ans = False
for a in n:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            ans = True
if ans:
    print("APPROVED")
else:
    print("DENIED")
Problem p02629 (python)

Fixed submission:
N = int(input())

s = []
a = 26
tmp = 1
for i in range(20):
    s.append(tmp)
    tmp += a
    a *= 26
    if tmp > 100000000000000000:
        break

for i in range(len(s)):
    if N >= s[i]:
        continue
    else:
        size = i 
        break

b = N - s[size-1]

n2a = lambda c: chr(c+64)
a = 26 ** (size-1)

ans = []
while(a >= 1):
    ans.append(n2a(b // a + 1).lower())
    b %= a
    a //= 26

print(*ans, sep="")

Buggy submission (verdict: Runtime Error):
N = int(input())

s = []
a = 26
tmp = 1
for i in range(20):
    s.append(tmp)
    tmp += a
    a *= 26
    if tmp > 1000000000000001:
        break

for i in range(len(s)):
    if N >= s[i]:
        continue
    else:
        size = i 
        break

b = N - s[size-1]

n2a = lambda c: chr(c+64)
a = 26 ** (size-1)

ans = []
while(a >= 1):
    ans.append(n2a(b // a + 1).lower())
    b %= a
    a //= 26

print(*ans, sep="")
Problem p02688 (python)

Fixed submission:
import numpy as np

N, K = map(int, input().split())

mat = np.array([[False] * N for i in range(K)])

for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    for j in range(d):
        mat[i][a[j]-1] = True

mat = mat.T

ans = 0
for i in range(N):
    flg = False
    for j in range(K):
        if mat[i][j]:
            flg = True

    if not flg:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split())

mat = np.array([[False] * N for i in range(N)])

for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    for j in range(d):
        mat[i][a[j]-1] = True

mat = mat.T


ans = 0
for i in range(N):
    flg = False
    for j in range(N):
        if mat[i][j]:
            flg = True

    if not flg:
        ans += 1

print(ans)
Problem p02759 (python)

Fixed submission:
N = int(input())
 
print(N//2 + N % 2)

Buggy submission (verdict: Runtime Error):
N = input()

print(N//2 + N % 2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)

N, M, K = map(int, input().split())

to = [[] for i in range(N)]
block = [[] for i in range(N)]
sets = []

is_visited = [False] * N
graph_g = [None] * N
graph_cnt = -1

def dfs(s, g):
    global graph_cnt
    if is_visited[s]:
        return graph_g[s]

    is_visited[s] = True
    if g == None:
        graph_cnt += 1
        graph_g[s] = graph_cnt
    else:
        graph_g[s] = g

    for edge in to[s]:
        dfs(edge, graph_cnt)


for i in range(M):
    A, B = map(int, input().split())
    to[A-1].append(B-1)
    to[B-1].append(A-1)

for i in range(K):
    C, D = map(int, input().split())
    block[C-1].append(D-1)
    block[D-1].append(C-1)

for i in range(N):
    dfs(i, None)

group_to_idx = [set() for i in range(graph_cnt+1)]
if len(group_to_idx) != 0:
    for i in range(N):
        group_to_idx[graph_g[i]].add(i)

ret = []
for i in range(N):
    cand = len(group_to_idx[graph_g[i]])
    fri = len(to[i])
    tmp_block = len(group_to_idx[graph_g[i]] & set(block[i]))

    tmp_ret = cand - fri - tmp_block - 1
    ret.append(tmp_ret)

print(*ret)
Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
M = N - K
mod = 10**9 + 7

class Combination:
    def __init__(self, n):
        self.facts = [1 for i in range(n+1)]
        self.invs = [1 for i in range(n+1)]
        
        for i in range(1, n+1):
            self.facts[i] = self.facts[i-1] * i % mod
            self.invs[i] = pow(self.facts[i], mod-2, mod)

    def ncr(self, n, r):
        if n < r:
            return 0
        if n < 0 or r < 0:
            return 0
        else:
            return self.facts[n] * self.invs[r] * self.invs[n-r] % mod

    def nhr(self, n, r): 
        return self.ncr(n+r-1, n-1)

comb = Combination(max(M+1, K-1))

for i in range(K):
    ans = comb.ncr(M+1, i+1) * comb.ncr(K-1, i)
    print(ans%mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
M = N - K
mod = 10**9 + 7

class Combination:
    def __init__(self, n):
        self.facts = [1 for i in range(n+1)]
        self.invs = [1 for i in range(n+1)]
        
        for i in range(1, n+1):
            self.facts[i] = self.facts[i-1] * i % mod
            self.invs[i] = pow(self.facts[i], mod-2, mod)

    def ncr(self, n, r):
        return self.facts[n] * self.invs[r] * self.invs[n-r] % mod

    def nhr(self, n, r): 
        return self.ncr(n+r-1, n-1)

comb = Combination(max(M+1, K-1))

for i in range(K):
    ans = comb.ncr(M+1, i+1) * comb.ncr(K-1, i)
    print(ans%mod)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(lambda x: int(x), input().split()))
Q = []

for i in range(M):
    Q.append(tuple(map(int, input().split())))

A.sort()

Q.sort(key=lambda x: x[1], reverse=True)

cur = 0
for i in range(M):
    cnt = Q[i][0]
    while cnt > 0 and cur < N:
        if A[cur] >= Q[i][1]:
            break
        A[cur] = Q[i][1]
        cur += 1
        cnt -= 1

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(lambda x: int(x), input().split()))
Q = []

for i in range(M):
    Q.append(tuple(map(int, input().split())))

A.sort()

Q.sort(key=lambda x: x[1], reverse=True)

cur = 0
for i in range(M):
    cnt = Q[i][0]
    while A[cur] < Q[i][1] and cnt > 0 and cur < N:
        A[cur] = Q[i][1]
        cur += 1
        cnt -= 1
    
    if A[cur] >= Q[i][1]:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(lambda x: int(x), input().split()))
Q = []

for i in range(M):
    Q.append(tuple(map(int, input().split())))

A.sort()

Q.sort(key=lambda x: x[1], reverse=True)

cur = 0
for i in range(M):
    cnt = Q[i][0]
    while A[cur] < Q[i][1] and cnt > 0:
        A[cur] = Q[i][1]
        cur += 1
        cnt -= 1
    
    if A[cur] >= Q[i][1]:
        break

print(sum(A))
Problem p02594 (python)

Fixed submission:
X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X = input()
if X>=30:
  print('Yes')
else:
  print('No')
Problem p02622 (python)

Fixed submission:
S=input()
T=input()
cout=0
for i in range(len(S)):
    if S[i]!=T[i]:
        cout=cout+1
print (cout)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
cout=0
for i in len(S):
  if S[i]!=T[i]:
    cout=cout+1
print (cout)

Buggy submission (verdict: Runtime Error):
S=str(input())
T=str(input()
if S==T:
      print('0')
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)
Problem p02759 (python)

Fixed submission:
print((int(input())+1)//2)

Buggy submission (verdict: Runtime Error):
N=int(input())
print((N+1/2)
Problem p02915 (python)

Fixed submission:
print(int(input())**3)

Buggy submission (verdict: Runtime Error):
print((input())^3)
Problem p02933 (python)

Fixed submission:
a=int(input())
s=str(input())
if a>=3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a=int(input())
s=int(input())
if a>=3200:
  print(s)
else:
  print('red')
Problem p03072 (python)

Fixed submission:
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[i]>=ans:
        x=x+1 
        ans=h[i]
print(x)

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>h[1] and h[0]>h[2] and h[0]>h[3]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>=h[1] and h[0]>=h[2]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)
Problem p02594 (python)

Fixed submission:
t = int(input())
if t >= 30:
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
t = int(input())
if t >=30 print("Yes")
else print("No")
Problem p02595 (python)

Fixed submission:
import math
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  _d = math.sqrt((x*x) + (y*y))
  if _d <= d:
    num += 1
  i += 1
 
print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  srq = x*x + y*y
  _d = sqrt(sqr)
  if _d <= d:
    num += 1
  i += 1
 
print(num)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  _d = sqrt((x*x) + (y*y))
  if _d <= d:
    num += 1
  i += 1
 
print(num)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  _d = sqrt((x*x) + (y*y))
  if _d <= d:
    num += 1
  i += 1
 
print(num)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  _d = sprt((x*x) + (y*y))
  if _d <= d:
    num += 1
  i += 1

print(num)
Problem p02596 (python)

Fixed submission:
k=int(input())
x=7
for i in range(1,k+1):
  if x%k==0:
    print(i)
    break
  x=(x*10+7)%k
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
pos = 0
curr = 7
k = int(input())
while true:
  pos += 1
  if curr % k == 0:
    break
  else : 
    k *= 10
    k += 7
print(pos)

Buggy submission (verdict: Runtime Error):
pos = 0
curr = 7
k = int(input())
while true:
  pos += 1
  if curr % k == 0:
    break
  else : 
    k = k*10 
    k += 7
print(pos)
Problem p02624 (python)

Fixed submission:
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    N = int(readline().rstrip())
    ans = 0
    for i in range(1, N+1):
        n = N // i
        ans += 0.5 * n * (2*i + i * (n-1))
    print(int(ans))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import sys
import collections
import bisect
import sympy
readline = sys.stdin.readline


def main():
    N = int(readline().rstrip())
    ans = 0
    for i in range(1, N+1):
        n = N // i
        ans += 0.5 * n * (2*i + i * (n-1))
    print(int(ans))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import sys
import collections
import bisect
import sympy
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    sumN = 0
    for i in range(n):
        sumN += len(sympy.divisors(i + 1)) * (i + 1)
    print(sumN)


if __name__ == '__main__':
    main()
Problem p02729 (python)

Fixed submission:
n,m = map(int, input().split())
print((n*(n-1)+m*(m-1))//2)

Buggy submission (verdict: Runtime Error):
import math
import sys
readline = sys.stdin.readline


def main():
    # input
    n = int(readline().rstrip())
    A = list(map(int, readline().rstrip().split()))
    B = [0] * n

    for a in A:
        B[a - 1] += 1

    total = 0
    for b in B:
        if b > 1:
            total += b * (b - 1) // 2

    C = [0] * n
    for i, b in enumerate(B):
        C[i] = total - b + 1

    for a in A:
        print(C[a-1])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import sys
readline = sys.stdin.readline


def main():
    # input
    n = int(readline().rstrip())
    A = list(map(int, readline().rstrip().split()))
    B = [0] * n

    for a in A:
        B[a - 1] += 1

    total = 0
    for b in B:
        if b > 1:
            total += b * (b - 1) // 2

    C = [0] * n
    for i, b in enumerate(B):
        C[i] = total - b + 1

    for a in A:
        print(C[a-1])


if __name__ == '__main__':
    main()
Problem p02933 (python)

Fixed submission:
a,s = [input() for i in range(2)]
print(s if int(a) >= 3200 else "red")

Buggy submission (verdict: Runtime Error):
a,s = [int(input()) for i in range(2)]
print(s if a >= 3200 else "red")
Problem p03307 (python)

Fixed submission:
n = int(input())
print(n if n % 2 == 0 else n * 2)

Buggy submission (verdict: Runtime Error):
print(n if n % 2 == 0 else n * 2)
Problem p03631 (python)

Fixed submission:
s = input()
print("Yes" if s[::-1]==s else "No")

Buggy submission (verdict: Runtime Error):
s = input()
print("Yes" if s[::-1]=s else "No")
Problem p03835 (python)

Fixed submission:
K,S = map(int,input().split())
cnt= 0

for x in range(0,K+1):
    for y in range(0,K+1):
        if(0 <= S - x - y and S - x - y <= K):
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
K=int(input())
S=int(input())
cnt= 0

for x in range(0,K+1):
    for y in range(0,K+1):
        for z in range(0,K+1):
            if ((x + y + z )== S):
                cnt += 1

print(cnt)
Problem p03127 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))

import math

s = []
m = a[0]

for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		if (i+1) not in s:
			s.append(i+1)
		if m//(i+1) not in s:
			s.append(m//(i+1))
s.sort()
s = reversed(s)

for i in s:
    for j in range(len(a)):
        if a[j]%i>0:
            break
    else:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

import math

s = []
m = a[0]

for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		if (i+1) not in s:
			s.append(i+1)
		if m//(i+1) not in s:
			s.append(n//(i+1))
s.reverse()

for i in s:
    for j in range(len(a)):
        if a[j]%i>0:
            break
    else:
        print(i)
        break
Problem p03242 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

input = raw_input()

result = " "
for i in range(0, 3):
    if input[i] == "1":
        result += "9"
    elif input[i] == "9":
        result += "1"
    else:
        result += input[i]

print int(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))
a = [v[i] for i in range(n) if i%2==0]
b = [v[i] for i in range(n) if i%2==1]

x = 0
y = 0
p=0
q=0

for i in range(10**5):
    if x<a.count(i):
        p=i
        x=a.count(i)
    if y<b.count(i):
        q=i
        y=b.count(i)

print(n-x-y)

Buggy submission (verdict: Runtime Error):
n = int(input())

m = 1110 - n

print m

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

input = raw_input()

result = ""
for i in range(0, 3):
    if input[i] == "1":
        result += "9"
    else input[i] == "9":
        result += "1"
    else:
        result += input[i]

print int(result)
Problem p03272 (python)

Fixed submission:
n, i = map(int, input().split())
print(n - i + 1)

Buggy submission (verdict: Runtime Error):
n, i = map(int,input().split())
print (N+i-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())

print u N-i+1

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())

print u N-i+1

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())

print u N-i+1

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())

print N-i+1

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())

print(N-i+1)
Problem p03307 (python)

Fixed submission:
n = int(input())

if n%2==0:
    print(n)

else:
    print(2 * n)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
A = sorted(A)
x = A[-1]-A[0]
print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int, input().split()))
S = sorted(S)
print(S[-1] - S[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int, input().split()))
S = sorted(S)
print(a[-1] - a[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int, input().split()))
a = sorted(S)
print(a[-1] - a[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int,input().split())

a=soretd(S)
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0])

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
  print(N)

else:
  print(2 ＊ N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0: 
         print(N)
else:
         print(2 ＊ N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
  print (N)
else:
  print (2 ＊ N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
  print(N)
else:
  print(2 ＊ N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
  print(N)
else:
  print(2N)

Buggy submission (verdict: Runtime Error):
N = int(input())

if N%2==0:
  print(N)
else:
  print(2＊N)
Problem p03315 (python)

Fixed submission:
S = input()

ans = 0
for i in range(len(S)):
    if S[i]=="+":
        ans += 1
    else:
        ans -= 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()

ans =0

for i in range(leg(s)):
 if s[i] =="+":
   ans += 1
 else:
  ans -=1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(input().split())

if a='+' b='+' c='+' d='+':
	print('4')
elif a='+' b='+' c='+' d='-':
	print('2')
elif a='+' b='+' c='-' d='+':
	print('2')
elif a='+' b='+' c='-' d='-':
	print('0')
elif a='+' b='-' c='+' d='+':
	print('2')
elif a='+' b='-' c='+' d='-':
	print('0')
elif a='+' b='-' c='-' d='+':
	print('0')
elif a='+' b='-' c='-' d='-':
	print('-2')
elif a='-' b='+' c='+' d='+':
	print('2')
elif a='-' b='+' c='+' d='-':
	print('0')
elif a='-' b='+' c='-' d='+':
	print('0')	
elif a='-' b='+' c='-' d='-':
	print('-2')
elif a='-' b='-' c='-' d='+':
	print('-2')
elif a='-' b='-' c='+' d='-':
	print('-2')
elif a='-' b='-' c='-' d='+':
	print('-2')
else a='-' b='-' c='-' d='-':
	print('-4')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(input().split())

if a='+' b='+' c='+' d='+':
	print('4')
elif a='+' b='+' c='+' d='-':
	print('2')
elif a='+' b='+' c='-' d='+':
	print('2')
elif a='+' b='+' c='-' d='-':
	print('0')
elif a='+' b='-' c='+' d='+':
	print('2')
elif a='+' b='-' c='+' d='-':
	print('0')
elif a='+' b='-' c='-' d='+':
	print('0')
elif a='+' b='-' c='-' d='-':
	print('-2')
elif a='-' b='+' c='+' d='+':
	print('2')
elif a='-' b='+' c='+' d='-':
	print('0')
elif a='-' b='+' c='-' d='+':
	print('0')	
elif a='-' b='+' c='-' d='-':
	print('-2')
elif a='-' b='-' c='-' d='+':
	print('-2')
elif a='-' b='-' c='+' d='-':
	print('-2')
elif a='-' b='-' c='-' d='+':
	print('-2')
else a='-' b='-' c='-' d='-':
	print('-4')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(input().split())

if a='+' b='+' c='+' d='+':
	print('4')
elif a='+' b='+' c='+' d='-':
	print('2')
elif a='+' b='+' c='-' d='+':
	print('2')
elif a='+' b='+' c='-' d='-':
	print('0')
elif a='+' b='-' c='+' d='+':
	print('2')
elif a='+' b='-' c='+' d='-':
	print('0')
elif a='+' b='-' c='-' d='+':
	print('0')
elif a='+' b='-' c='-' d='-':
	print('-2')
elif a='-' b='+' c='+' d='+':
	print('2')
elif a='-' b='+' c='+' d='-':
	print('0')
elif a='-' b='+' c='-' d='+':
	print('0')	
elif a='-' b='+' c='-' d='-':
	print('-2')
elif a='-' b='-' c='-' d='+':
	print('-2')
elif a='-' b='-' c='+' d='-'
	print('-2')
elif a='-' b='-' c='-' d='+'
	print('-2')
else a='-' b='-' c='-' d='-'
	print('-4')
Problem p02753 (python)

Fixed submission:
word = input()

if word[0] == word[1] and word[1] == word[2] and word[0] == word[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
word = input()
a,b = 0

for i in word:
    if i == "A":
        a=a+1
    elif i == "B":
        b=b+1

if a==0 or b==0:
    print("No")
else:
    print("Yes")
Problem p02759 (python)

Fixed submission:
pages=int(input())
papers=pages/2
res=int(papers)
if pages%2==0:
    print(res)
else:
    print(res+1)

Buggy submission (verdict: Runtime Error):
pages=int(input())
papers=round(pages/2 + pages%2)

if pages%2=0:
    print(papers)
else:
    print(pages/2 + pages%2 - 1)
Problem p02777 (python)

Fixed submission:
s,t = input().split()
a,b = map(int, input().split())
u = input()

if u == s:
  a = a - 1
if u == t:
  b = b - 1

print(a,b)

Buggy submission (verdict: Runtime Error):
while True:
    s,t = input().split()
    a,b = map(int, input().split())
    u = input()

    if u == s:
        a = a - 1
    if u == t:
        b = b - 1

    print(a,b)
Problem p02711 (python)

Fixed submission:
n=input()
if '7' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
if 7 in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
if '7' in n:
    print('Yes')
else:
    print('No')