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

Fixed submission:
S, W = map(int,input().split())

if S <= W:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())

if S < W:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())

if S <= W:
    print('unsafe')
else:
    print('safe')
Problem p02701 (python)

Fixed submission:
import collections

num = int(input())
S = [str(input()) for _ in range(num)]

print(len(collections.Counter(S)))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [str(input()) for _ in range(N)]

S = list(S)

for i in range(N):
    for j in range(N-1):
        if S[i] == S[j+1]:
            X = N - 1

print(X)
Problem p02712 (python)

Fixed submission:
x = int(input())
N = 0
 
for i in range(1,x+1):
    if i%3==0 and i%5==0:
        pass
    elif i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        N = i + N
        
print(N)

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

for i in range(x):
    if i%3==0 and i%5==0:
        i = 'FizzBuzz'
    elif i%3==0:
        i = 'Fizz'
    elif i%5==0:
        i = 'Buzz'
    else:
        N = i + N
        
print(N)
Problem p02723 (python)

Fixed submission:
coffee = input()

if coffee[2] == coffee[3] and coffee[4] == coffee[5]:
    print("Yes")
else:
    print("No")

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

if coffee[2] = coffee[3] and coffee[4] = coffee[5]:
    print("Yes")
else:
    print("No")
Problem p02596 (python)

Fixed submission:
def calc(k):
    cur = 0
    for i in range(1, 10 ** 7):
        cur *= 10
        cur += 7
        cur %= k
        if cur == 0:
            return i

    return -1


k = int(input())
print(calc(k))

Buggy submission (verdict: Runtime Error):
k = int(input())
i = len(str(k))
cnt = 0
kanou = ["1","3","7","9"]
hukanou = ["0","2","4","5","6","8"]
if (str(k)[len(str(k))-1]) in kanou:
    cnt = 0
    for i in range(i):
        if str(k)[i] in hukanou:
            cnt = 1
            break
    if cnt == 0:
        while True:
            if(int('7'*i))%k==0:
                cnt = 1
                break
            else:
                i += 1
        print(i)
    elif cnt == 1:
        if k%7==0 and k%3==0:
            print(k)
        else:
            print(k-1)
else:
    print(-1)
Problem p02695 (python)

Fixed submission:
n, mm, q = map(int,input().split())
a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
import itertools
td = []
ttd = []

m = []
for i in range(1,mm+1):
    m.append(i)

s = list(itertools.combinations_with_replacement(m, n))
for j in range(len(s)):
    for i in range(q):
        if s[j][b[i]-1] - s[j][a[i]-1] == c[i]:
            td.append(d[i])
    ttd.append(sum(td))
    td = []
if ttd==[]:
    print(0)
else:
    print(max(ttd))

Buggy submission (verdict: Runtime Error):
n, mm, q = map(int,input().split())
a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
import itertools
td = []
ttd = []

m = []
for i in range(1,mm+1):
    m.append(i)

s = list(itertools.combinations(m, n))
for j in range(len(s)):
    for i in range(q):
        if s[j][b[i]-1] - s[j][a[i]-1] == c[i]:
            td.append(d[i])
    ttd.append(sum(td))
    td = []
print(max(ttd))
Problem p02777 (python)

Fixed submission:
s = input().split()
a,b = map(int,input().split())
u = input()
if u==s[0]:
    print(a-1,b)
else:
    print(a,b-1)

Buggy submission (verdict: Runtime Error):
s,t = map(input().split())
a,b = map(int,input().spli())
u = input()
if u==s:
    print(a-1,b)
else:
    print(a,b-1)
Problem p02831 (python)

Fixed submission:
a,b = map(int,input().split())
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
Problem p02847 (python)

Fixed submission:
S = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
s = input()
result = abs(S.index(s)-S.index("SUN"))
if result ==0:
  result = 7
else:
  pass
print(result)

Buggy submission (verdict: Runtime Error):
S = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
s = print()
result = abs(S.index(s)-S.index("SUN"))
print(result)
Problem p02550 (python)

Fixed submission:
N, X, M = map(int, input().split())

appearance = [0] * (M + 1)
cum_sum = [0]
A = X
appearance[A] = 1
cum_sum.append(A)
a = 1
for a in range(2, N + 1):
    A = (A**2)%M
    if appearance[A] != 0:
        n = a - 1
        break
    appearance[A] = a
    cum_sum.append(cum_sum[a - 1] + A)
else: n = a

k = appearance[A]
l = (N - n) // (n - k + 1)
m = (N - n) - (n - k + 1)*l + k - 1

ans = cum_sum[n] + (cum_sum[n] - cum_sum[k - 1])*l + cum_sum[m] - cum_sum[k - 1]
print(ans)

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

appearance = [0] * (M + 1)
cum_sum = [0]
A = X
appearance[A] = 1
cum_sum.append(A)
for a in range(2, N + 1):
    A = (A**2)%M
    if appearance[A] != 0:
        n = a - 1
        break
    appearance[A] = a
    cum_sum.append(cum_sum[-1] + A)
else: n = a

k = appearance[A]
l = (N - n) // (n - k + 1)
m = (N - n) - (n - k + 1)*l + k - 1

ans = cum_sum[n] + (cum_sum[n] - cum_sum[k - 1])*l + cum_sum[m] - cum_sum[k - 1]
print(ans)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()

ans = 0
for i in range(len(S) - len(T) + 1):
  tmp = 0
  for j in range(len(T)):
    if S[i + j] == T[j]:
      tmp += 1
  ans = max(ans, tmp)

print(len(T) - ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

ans = 0
for i in range(len(S)):
  tmp = 0
  for j in range(len(T)):
    if S[i + j] == T[j]:
      tmp += 1
  ans = max(ans, tmp)

print(len(T) - ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

ans = 0
for i in range(len(S)):
  tmp = 0
  for j in range(len(T)):
    if S[i + j] == T[j]:
      tmp += 1
    ans = max(ans, tmp)

print(len(T) - ans)
Problem p02594 (python)

Fixed submission:
X = int(input())

print("Yes") if X >= 30 else print("No")

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse = True)

ans_l = 0
ans_h = A[0]
while ans_l != ans_h:
    ans_m = (ans_l + ans_h) // 2
    tmp_n = 0
    for a in A:
        tmp_n += math.ceil(a / ans_m) - 1
    if tmp_n > K:
        ans_l = ans_m + 1
    else:
        ans_h = ans_m

print(ans_h)
Problem p02954 (python)

Fixed submission:
S = input()

n = len(S)

l = [0]*n
current_run = 'R'
R_start = 0

for i in range(n-1):
    if current_run == 'R':
        if S[i+1] == 'L':
            R_len = i+1 - R_start
            current_run = 'L'
            L_start = i+1
            if i == n-2:
                placeR = L_start - 1
                placeL = L_start
                L_len = 1
                D_len = (R_len + L_len) // 2
                l[placeR] = D_len
                l[placeL] = D_len
                if (R_len + L_len) % 2 == 0:
                    continue
                if R_len > D_len:
                    if R_len % 2 == 0:
                        l[placeL] += 1
                    else:
                        l[placeR] += 1

    else:
        if S[i+1] == 'R' or i == n-2:
            L_len = i+1 - L_start
            if i == n-2: L_len += 1
            current_run = 'R'
            R_start = i+1
            placeR = L_start - 1
            placeL = L_start
            D_len = (R_len + L_len) // 2
            l[placeR] = D_len
            l[placeL] = D_len
            if (R_len + L_len) % 2 == 0:
                continue
            if R_len > D_len:
                if R_len % 2 == 0:
                    l[placeL] += 1
                else:
                    l[placeR] += 1
            elif L_len > D_len:
                if L_len % 2 == 0:
                    l[placeR] += 1
                else:
                    l[placeL] += 1

print(" ".join([str(_) for _ in l]))

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

n = len(S)

l = [0]*n
current_run = 'R'
R_start = 0

for i in range(n-1):
    if current_run == 'R':
        if S[i+1] == 'L':
            R_len = i+1 - R_start
            current_run = 'L'
            L_start = i+1
            if i == n-2:
                placeR = L_start - 1
                placeL = L_start
                D_len = (R_len + L_len) // 2
                l[placeR] = D_len
                l[placeL] = D_len
                if (R_len + L_len) % 2 == 0:
                    continue
                if R_len > D_len:
                    if R_len % 2 == 0:
                        l[placeL] += 1
                    else:
                        l[placeR] += 1

    else:
        if S[i+1] == 'R' or i == n-2:
            L_len = i+1 - L_start
            if i == n-2: L_len += 1
            current_run = 'R'
            R_start = i+1
            placeR = L_start - 1
            placeL = L_start
            D_len = (R_len + L_len) // 2
            l[placeR] = D_len
            l[placeL] = D_len
            if (R_len + L_len) % 2 == 0:
                continue
            if R_len > D_len:
                if R_len % 2 == 0:
                    l[placeL] += 1
                else:
                    l[placeR] += 1
            elif L_len > D_len:
                if L_len % 2 == 0:
                    l[placeR] += 1
                else:
                    l[placeL] += 1

print(" ".join([str(_) for _ in l]))
Problem p02549 (python)

Fixed submission:
MOD = 998244353
N, K = map(int, input().split())
LR = [tuple(map(int, input().split())) for i in range(K)]
 
dp = [0] * (N+1)
dp[1] = 1    #ok
for i in range(1, N):
  dp[i] += dp[i-1]   #as min k = 1, so carry this on to the next
  dp[i] %= MOD
  for l, r in LR:
    ll = i + l
    rr = i + r
    if ll <= N:
      dp[ll] += dp[i]    #yes ll is accesible
      dp[ll] %= MOD
    if rr < N:
      dp[rr+1] -= dp[i]    #not accessible and will get cancelled out when we take prefix sum
      dp[rr+1] %= MOD
 
print(dp[-1])

Buggy submission (verdict: Runtime Error):
'''go to every index and then run a index - 1 to 1 for it and check whether the proposed number lies somewhere or not'''
n,k = tuple(map(int,input().split()))
boolean = [False]*n
for _ in range(k):
  l,r = tuple(map(int,input().split()))
  for num in range(l,r+1):
    boolean[num] = True;
dp = [0 for _ in range(n+1)]
boolean = [False for _ in range(n+1)]
for i in range(2,n+1):
  for lower in range(1,i):
    if boolean[lower]:
    	start = i - lower
        dp[i] += dp[start]
print(dp[n])
Problem p02570 (python)

Fixed submission:
D,T,S = map(int,input().split())

if S * T >= D:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
if S * T >= D:
  print('Yes')
else:
  print('No')
Problem p02622 (python)

Fixed submission:
s = input()
t = input()

s_len = len(s)
count = 0
for i in range(s_len):
  if s[i] !=  t[i]:
    count += 1
print(count)

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

s_len = len(s)
count = 0
for i in range(s):
  if s[i] !=  t[i]:
    count += 1
print(count)
Problem p02759 (python)

Fixed submission:
#!/usr/bin/env python3


def main():
    N = int(input())
    print(-(-N // 2))


main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3


def main():
    N = map(int, open(0).read().split())
    print(-(-N // 2))


main()
Problem p02572 (python)

Fixed submission:
def calc(A, N, i):
    ans = 0
    ai = A[i]
    for i in range(i, N - 1):
        aj = A[i + 1]
        ans += ai * aj
    return (ans)


def main():
    N = int(input())
    A = list(map(int, input().split()))
    mod_v = 10**9 + 7
    ans = [0] * (N + 1)
    for i in range(0, N - 1):
        if A[i] != 0:
            ans[i] = calc(A, N, i)
            break
    for j in range(i + 1, N - 1):
        if A[j] != 0:
            ans[j] = (ans[j - 1] - A[j - 1] * A[j]) // A[j - 1] * A[j]
        else:
            ans[j] = 0
    ret = 0
    for k in range(0, N):
        ret += ans[k]
    ret = ret % mod_v
    print(ret)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    mod_v = 10**9 + 7
    ans = [0] * (N + 1)
    for i in range(0, N - 1):
        ai = A[0]
        aj = A[i + 1]
        ans[0] += ai * aj
    for j in range(1, N - 1):
        ans[j] = (ans[j - 1] - A[j - 1] * A[j]) // A[j - 1] * A[j]
    ret = 0
    for k in range(0, N):
        ret += ans[k]
    ret = ret % mod_v
    print(ret)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    mod_v = 10**9 + 7
    ans = [0] * (N + 1)
    for i in range(0, N - 1):
        ai = A[0]
        aj = A[i + 1]
        ans[0] += ai * aj
    for j in range(1, N - 1):
        ans[j] = (ans[j - 1] - A[j - 1] * A[j]) // A[j - 1] * A[j]
    ret = 0
    for k in range(0, N):
        ret += ans[k]
    if ret > mod_v:
        ret = ret % mod_v
    print(ret)


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

Fixed submission:
import math

def main():
    N, D = list(map(int, input().split()))
    ans = 0
    for i in range(0,N):
        A, B = list(map(int, input().split()))
        dist = math.sqrt(A**2 + B**2)
        if dist <= D:
            ans +=1
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, D = list(map(int, input().split()))
    ans = 0
    for i in range(0,N):
        A, B = list(map(int, input().split()))
        if dist <= D:
            ans +=1
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, D = list(map(int, input().split()))
    ans = 0
    for i in range(0,N):
        A, B = list(map(int, input().split()))
        print(dist)
        if dist <= D:
            ans +=1
    print(ans)


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

Fixed submission:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
a = str(input())
if a.isupper():
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
N = int(input())
ab = [chr(ord('a') + i) for i in range(26)]
j = 1
while True:
  temp = 1000000000000001//(26**j)
  j+=1
  if temp<1:
    break
ans = ''
for i in range(1, j+2):
  ax = (N//(26**(i-1)))%26
  if ax==0:
    ax = 25
  ans += ab[ax]
  if N//(26**i)<1:
    print(ans[::-1])
    sys.exit()
Problem p02659 (python)

Fixed submission:
import decimal

a,b = input().split()
a = int(a)
b = decimal.Decimal(b)
b = b*100
b = int(b)

ans = a*b
ans //= 100

print(int(ans))

Buggy submission (verdict: Runtime Error):
import decimal

a,b = input().split()
a = int(a)
b = decimal(b)
b = b*100
b = int(b)

ans = a*b
ans //= 100

print(int(ans))
Problem p02571 (python)

Fixed submission:
s = input()
t = input()

stri = []
for i in range(len(s)-len(t)+1):
    j = i+ len(t)
    stri.append(s[i:j])
maxcount = 0
for i in range(len(stri)):
    count = 0
    for j in range(len(t)):
        if(stri[i][j] ==t[j]):
            count+= 1
    maxcount = max(maxcount,count) 
print(len(t)-maxcount)

Buggy submission (verdict: Runtime Error):
vs = input()
t = input()

stri = []
mincount = -1
for i in range(len(s)-len(t)+1):
    count = 0
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            count+= 1
    mincount = max(mincount,count) 
print(len(t) - mincount)
Problem p02580 (python)

Fixed submission:
import sys
h,w,m = map(int,input().split())
hight = [0]*h
width = [0]*w
S = set()

for i in range(m):
    hi,wi = map(int,input().split())
    S.add((hi-1,wi-1))
    hight[hi-1] += 1
    width[wi-1] += 1

max_vh = max(hight)
max_vw = max(width)

max_h = [i for i in range(h) if hight[i] == max_vh]
max_w = [i for i in range(w) if width[i] == max_vw]
for i in max_h:
    for j in max_w:
        if not(i,j) in S:
            print(max_vh+max_vw)
            sys.exit()

print(max_vh+max_vw-1)

Buggy submission (verdict: Runtime Error):
import numpy
h,w,m = map(int,input().split())
hight = [0]*h
width = [0]*w
matrix =[0]*h
for i in range(h):
    matrix[i] = [0]*w
for i in range(m):
    hi,wi = map(int,input().split())
    hight[hi-1] += 1
    width[wi-1] += 1
    matrix[hi-1][wi-1] += 1
max_vh = numpy.argmax(hight)
max_vw = numpy.argmax(width)
f = 1
for i in range(m):
    if(matrix[max_vh][i] == 0):
        f = 0
        break
 
print(hight[max_vh] + width[max_vw]-f)

# 3 2 22
# 3 2
# 1 2

Buggy submission (verdict: Runtime Error):
import numpy
h,w,m = map(int,input().split())
hight = [0]*h
width = [0]*w
matrix =[0]*w
for i in range(w):
    matrix[i] = [0]*h
for i in range(m):
    hi,wi = map(int,input().split())
    hight[hi-1]+=1
    width[wi-1]+=1
    matrix[wi-1][hi-1] += 1
# print(matrix)
max_vh = numpy.argmax(hight)
max_vw = numpy.argmax(width)
print(hight[max_vh]+width[max_vh]-matrix[max_vw][max_vh])
Problem p02597 (python)

Fixed submission:
N = int(input())
stone = list(map(str,input()))
ind = [""]*2
ind[0] = list()
ind[1] = list()
R = 0
W = 0
for i in range(N):
    if(stone[i]=="W"):
        ind[0].append(i)
        W += 1
    else:
        ind[1].append(i)
        R += 1
newR = 0
for i in range(R):
    if(i != ind[1][i]):
        break
    newR+= 1


newind =list(reversed(ind[1]))
ans2 = 0

# print(W,R,newR)
# print(ind[1],newind)
if(newR != R):
    ans1 = min(W,R-newR)
else:
    ans1 = min(W,R)
if(ans1 != 0):
    for i in range(N//2):
        if(ind[0][i]>newind[i]):
            break
        ans2+=1
        # print(ans)
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
N = int(input())
stone = list(map(str,input()))
ind = [""]*2
ind[0] = list()
ind[1] = list()
R = 0
W = 0
for i in range(N):
    if(stone[i]=="W"):
        ind[0].append(i)
        W += 1
    else:
        ind[1].append(i)
        R += 1
ind[1].reverse()
ans = 0

if(W != R):
    print(min(W,R))
else:
    for i in range(N):
        if(ind[0][i]>ind[1][i]):
            break
        ans+=1
    print(ans)
Problem p02659 (python)

Fixed submission:
import math
a,b = map(str,input().split())
a = int(a)
b_ =str()
for i in b:
    if(i != "."):
        b_ = b_ +i
# print(b_)
b_ = int(b_)
ans = (a*b_)//100
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str,input().split())
a = int(a)
b_ =str()
for i in b:
    if(i != "."):
        b_ = b_ +i
# print(b_)
ans = (a*b_)//100
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str,input().split())
a = int(a)
b.remove(".")
# print(a,b)
b = int(b)
ans = (a*b)//100
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str,input().split())
a = int(a)
b.remove(,)
# print(a,b)
b = int(b)
ans = (a*b)//100
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(str,input().split())
a = int(a)
b = b.remove(,)
# print(a,b)
b = int((b))
ans = (a*b)//100
print(ans)
Problem p02693 (python)

Fixed submission:
K =int(input())
A,B = map(int,input().split())
f = 0
for i in range(A,B+1):

    if(i%K==0):
        print("OK")
        f =1
        break

if(f ==0):
    print("NG")

Buggy submission (verdict: Runtime Error):
from math import floor
A,B,N = map(int,input().split())
if(B-1>N):
    Nomin = floor(N)
else:
    Nomin = floor(B-1)

print(Nomin)
Problem p02707 (python)

Fixed submission:
N = int(input())
emp = list(map(int,input().split()))
ans_l = [0]*(N+1)
for i in range(N-1):
    a = emp[i]
    ans_l[a] +=1
for i in range(1,N+1):
    print(ans_l[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
emp = list(map(int,input().split()))
list.sort()
for i in range(N):
    print(emp.index(i+2)-emp.index(i+1))

Buggy submission (verdict: Runtime Error):
N = int(input())
emp = list(map(int,input().split()))
for i in range(N):
    print(emp.count(i+1))
    emp.remove(i+1)
Problem p02711 (python)

Fixed submission:
N = str(input())
array = list(map(str,N))
i= 0
while all:
    if(array[i]=='7'):
        print("Yes")
        break
    if(i==2):
        print("No")
        break
    i+=1

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input())
f=0
ijk = list()
for i in range(N):
    for j in range(N):
        for k in range(N):
            if(k>j>i):
                if(k == j+(j-i)):
                    pass
                elif(i == j-(j-k)):
                    pass
                else:
                    ijk.append([i+1,j+1,k+1])
# print(S)
# print(ijk)

for i in range(len(ijk)):
    if(S[ijk[i][0]-1]== S[ijk[i][1]-1]):pass
    elif(S[ijk[i][0]-1]== S[ijk[i][2]-1]):pass
    elif(S[ijk[i][1]-1]== S[ijk[i][2]-1]):pass
    else:f+=1
print(f)
Problem p02880 (python)

Fixed submission:
n = int(input())
flag = False
for x in (range(1,10)):
    for y in (range(1,10)):
        if x * y == n:
            flag = True
    else:
        continue
    break
    

if flag:
    print("Yes")
else:
    print("No")

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

for x in (range(1,10)):
    for y in (range(1,10)):
        if x * y == n:
            flag = True
    else:
        continue
    break
    

if flag:
    print("Yes")
else:
    print("No")
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
x = n//2
n =n%2 
print(x+y)
Problem p02951 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[2]>(a[0]-a[1]):
    print(a[2]-(a[0]-a[1]))
else:print(0)

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

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
    print(max(a[2]-(a[0]-a[1]),0))
Problem p02572 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
MOD=10**9+7
def findProductSum(A, n): 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum=array_sum+A[i]
    array_sum_square = array_sum * array_sum 
    individual_square_sum = 0
    for i in range(n): 
        individual_square_sum += A[i] * A[i]
    return (array_sum_square - individual_square_sum)//2

print(findProductSum(a,n)%MOD)

Buggy submission (verdict: Runtime Error):
hu
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
 
print("unsafe" if W >= S else "safe")

Buggy submission (verdict: Runtime Error):
S=int()
W=int()
S=input()
W=input()

if S<=W:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
S=int()
W=int()
S=input()
W=input()

if S<=W:
    print("unsafe")
else:
    print("safe")
Problem p02547 (python)

Fixed submission:
n = int(input())

d = []
for i in range(n):
    d.append(list(map(int, input().split())))

def dice():
    cnt =0
    for i in range(n):
        if d[i][0] == d[i][1]:
            cnt += 1
            if cnt == 3:
                return "Yes"
                break
        else:
            cnt = 0
    return "No"

ans = dice()

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt =0
def dice():
    for i in range(n):
        d = list(map(int, input().split()))
        if d[0] == d[1]:
            cnt += 1
            if cnt == 3:
                return "Yes"
            
        else:
            cnt = 0

ans = dice()

print(ans)
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 1:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
x = int(input())
if x = 1:
  print("0")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
x = int(input())
if x = 0:
  print(1)
else:
  print(0)
Problem p02570 (python)

Fixed submission:
d, t, s = map(int, input().split())
if d/s <= t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input()) #入力する整数
A = list(map(int,input().split())) #入力する数列A
SUMA = sum(A) #数列の和
MOD = 10**9 + 7 # mod
C = [0] * (N-1) #累積和数列
for i in range(N-1): #\sum_{j = i+1}^{N}を求めて数列に代入する
  SUMA -= A[i]
  C[i] = SUMA
ans = 0 #求める答え
for i in range(N-1):
  ans += A[i]*C[i]
  ans %= MOD #その都度modで割った余りにする
print(ans) #答えを出力する