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

Fixed submission:
A, B = map(int,input().split())
n=0
for i in range(A,B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
n=0
for i in range(A:B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)
Problem p02981 (python)

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

if a*n <= b:
  print(a*n)
else:
  print(b)

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

if a*n>=b:
  print(a*n)
else:
  prinb(b)
Problem p02917 (python)

Fixed submission:
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[N-2]
for i in range(1, N-1):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = [B[0]+B[-1]]
A = [ min(B[i],B[i+1] for i in range (N-2) ]
C = sum(k + A)
print(C)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[-1]
A = [ min(B[i],B[i+1] for i in range (N-2) ]
C = sum(k + A)
print(C)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = B[0]
for i in range(1, N):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)
Problem p02921 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
k = 1
s=0
while k < B:
    k += A - 1
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
e=input(”S"）
r=input(”T")
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

Buggy submission (verdict: Runtime Error):
e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

Buggy submission (verdict: Runtime Error):
e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N):
    if k < m:
        k = m
    if i != N - 1 and H[i] >= H[i+1]:
        m += 1
    else:
        m =0
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
res = 0
temp = 0
for i in range(N):
    if temp > res:
        res = temp
    if H[i] >= H[i+1]:
        temp += 1
    else :
        temp = 0
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
k = 0
while H[i] >= H[i+1] for i in range(N):
    k += 1
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N-1):
    while H[i] >= H[i+1]:
        i += 1
        m += 1
    if k < m:
        k = m
    m = 0
print(k)
Problem p02946 (python)

Fixed submission:
K, X = map(int, input().split())
for i in range(X - K + 1, X + K):
    print(i, end = ' ')

Buggy submission (verdict: Runtime Error):
K, X = map(int, input().split())
list =[]
for i in range(X - K + 1, X + K):
    x.append(i)
print(list)
Problem p02947 (python)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [sorted(input()) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        sum +=s_dict[s[i]]
        s_dict[s[i]] += 1
    else:
        s_dict[s[i]] = 1
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        sum +=s_dict(s[i])
        s_dict(s[i]) += 1
    else:
        s_dict(s[i]) = 1
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        s_dict(s[i]) += 1
        sum += s_dict(s[i])
    else:
        s_dict(s[i]) = 1
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [sorted(input()) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        s_dict(s[i]) += 1
        sum +=s_dict(s[i])
    else:
        s_dict(s[i]) = 1
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range()]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
k = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        if s[i] == s[k] :
            k += 1
print(k)
Problem p02952 (python)

Fixed submission:
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i =< 9:
        k += 1
    elif 100 =< i =< 999:
        k += 1
    elif 10000 =< i =< 99999:
        k += 1
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i < 10:
        k += 1
    elif 100 =< i < 1000:
        k += 1
    elif 10000 =< i < 100000:
        k += 1
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i < 10:
        k += 1
    if 100 =< i < 1000:
        k += 1
    if 10000 =< i < 100000:
        k += 1
print(k)

Buggy submission (verdict: Runtime Error):
N =int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i <10:
        k += 1
    if 100 =< i <1000:
        k += 1
    if 10000 =< i <100000:
        k += 1
print(k)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        h[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if h[i] < h[i+1] :
        h[i+1] -= 1
    elif h[i] > h[i+1]:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            exit()
if ans == 0:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            break
    else:
        continue
    break
if ans == 0:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            break
if ans == 0:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            break
        else:
            print('Yes')
Problem p02971 (python)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if A[i] == A_sort[-1] :
        print(A_sort[-2])
    else :
        print(A_sort[-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if a[i] == a[-1] :
        print(a[-2])
    else :
        print(a[-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [map(int, input()split()) for _ in range(N)]
for i in range(N) :
    k = A[i]
    del A[i]
    print(max(A))
    A.insert(i, k)
Problem p02982 (python)

Fixed submission:
N, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l' += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        length' = 0.0
        for d in range(D) :
            length' += (x[i][d] - x[j][d]) ** 2
        length = length' ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
# for _ in range でリストを何行にもわたって書ける
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        length' = 0.0
        for d in range(D) :
            length' += (x[i][d] - x[j][d]) ** 2
        length = length' ** (1/2)
        if length.is_integer() :
        # 整数かどうか判定
            s += 1
print(s)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            t.append((i * j) % 2019)
    print(min(t))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            list.append((i * j) % 2019)
    print(min(t))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
    print(min(t))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R+1):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
    print(min(t))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
t = []
else :
    for i in range(L, R+1):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
print(min(t))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
print(min(list))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
    list.append(i % 2019)
list_sort = sorted(list)
l = list_sort[0] * list_sort[1]
print(l % 2019)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
    list.append(i % 2019)
list_sort = sorted(list)
l = list_sort[0] * list_sort[1]
print(l % 2019)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
    k = i % 2019
    list.append(k)
    k = 0
list_sort = sorted(list)
l = list_sort[0] * list_sort[1]
print(l % 2019)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
    k = i % 2019
    list.append(k)
    k = 0
list_sort = sorted(list())
l = list_sort[0] * list_sort[1]
print(l % 2019)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if R - L >= 2018 :
    print(0)
list = []
else :
    for i in range(L, R+1):
    k = i % 2019
    list.append(k)
    k = 0
list_sort = sorted(list())
l = list_sort[0] * list_sort[1]
print(l % 2019)
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    a, b = b, a % b
    if b == 0 :
        return a
    else:
        return gcd(a, b)
cd = C * D //gcd(C, D)
print(B - B // C - B // D + B // cd - A + 1 + (A - 1) // C + (A - 1)// D - (A - 1)// cd)

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
num = 0
for i in range(A, B+1):
    if i % C = 0:
        num += 1
    elif i % D = 0:
        num += 1
x_num = B - A + 1 - num
print(x_num)
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(int, input().split())
if W/2 == x and H/2 == y:
    print(str(W*H/2)+ ' ' +str(1))
else:
    print(str(W*H/2)+ ' ' +str(0))

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
if W % 2 == 0 and H % 2 == 0 and x, y = W/2, H/2 :
    print(str(W*H/2)+ ' ' + str(1))
else:
    print(str(w*H/2)+ ' ' + str(0))

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
if W % 2 == 0 and H % 2 == 0 and x, y = W/2, H/2 :
    print(W * H /2, 1)
else:
    print(W * H /2, 0)
Problem p03029 (python)

Fixed submission:
A, P =map(int, input().split())
pie = (A * 3 + P)//2
print(pie)

Buggy submission (verdict: Runtime Error):
A ,P = int(input()).split()

P = P + 3 * A
k = P//2
print(k)

Buggy submission (verdict: Runtime Error):
A = int(input('A'))
P = int(input('P'))

P = P + 3 * A
k = P//2
print(k)
Problem p02945 (python)

Fixed submission:
a,b = [int(x) for x in input().split()]
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(max(a+b,a-b,a*b))
Problem p03145 (python)

Fixed submission:
a,b,c = map(int, input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
print(input()*input()/2)
Problem p03361 (python)

Fixed submission:
a =str(input()).split(" ")
h = int(a[0])
w = int(a[1])
maps= []

for i in range(h):
    maps.append(list(input()))

for i in range(h):
    for j in range(w):
        if maps[i][j] == "#":
            if j - 1 >= 0 and maps[i][j - 1] == "#":
                continue
            elif j + 1 < w and maps[i][j + 1] == "#" :
                continue
            elif i + 1 < h and maps[i + 1][j] == "#" :
                continue
            elif i - 1 >= 0 and maps[i - 1][j] == "#":
                continue
            else:
                print("No")
                exit()
        else:
            pass
print("Yes")

Buggy submission (verdict: Runtime Error):
a =str(input()).split(" ")
h = int(a[0])
w = int(a[1])
maps= []

for i in range(h):
    maps.append(list(input()))
   
for i in range(h - 1 ):
    for j in range(w:
        if maps[i][j] == "#":
            if j - 1 > 0 and maps[i][j - 1] == "#":
                continue
            elif j + 1 < w and maps[i][j + 1] == "#" :
                continue
            elif i + 1 < h and maps[i + 1][j] == "#" :
                continue
            elif i - 1 > 0 and maps[i - 1][j] == "#":
                continue
            else:
                print("No")
                exit()
        else:
            pass
print("Yes")

Buggy submission (verdict: Runtime Error):
a =str(input()).split(" ")
h = int(a[0])
w = int(a[1])
maps= []

for i in range(h):
    maps.append(list(input()))
   
for i in range(h-1):
    for j in range(w):
        if maps[i][j] == "#":
            if maps[i][j - 1] == "#" and j - 1 > 0:
                continue
            elif maps[i][j + 1] == "#" and j + 1 < w:
                continue
            elif maps[i + 1][j] == "#" and i + 1 < h:
                continue
            elif maps[i - 1][j] == "#" and i - 1 > 0:
                continue
            else:
                print("No")
                exit()
        else:
            pass

print("Yes")
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int, input().split())
only = a * x + b * y 
ans = only
for i in range(1,x + 1):
    current = 0
    current = c * i * 2
    if y - i >= 0:
        current = current + a * ( x - i ) + b * (y - i)
    else:
        current = current + a * ( x - i )
    if ans > current:
        ans = current
for i in range(1,y + 1):
    current = 0
    current = c * i * 2
    if x - i >= 0:
        current = current + a * ( x - i ) + b * ( y - i )
    else:
        current = current + b * ( y - i )
    if ans > current:
        ans = current
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int, input().split())
only = a * x + b * y 
ans = only
for i in range(1,x + 1):
    current = 0
    current = c * i * 2
    if y - i >= 0:
        current = current + a * ( x - i ) + b * (y - i)
    else:
        current = current + a * ( x - i )
    if ans > current:
        ans = currents
for i in range(1,y + 1):
    current = 0
    current = c * i * 2
    if x - i >= 0:
        current = current + a * ( x - i ) + b * ( y - i )
    else:
        current = current + b * ( y - i )
    if ans > current:
        ans = current
print(ans)
Problem p03169 (python)

Fixed submission:
import collections

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

d = collections.Counter(a)
s = sum(a)
n1, n2, n3 = d[1], d[2], d[3]

dp = [[0]*(n2+n3+1) for _ in range(n3+1)]
dp[n3][n2] = 1.0
ans = 0

for i in range(s, 0, -1):
  dp2 = [[0]*(n2+n3+1) for _ in range(n3+1)]
  for i3 in range(n3, -1, -1):
    for i2 in range(min(n2+n3, (i-i3*3)//2), -1, -1):
      i1 = i-i3*3-i2*2
      i0 = n-i1-i2-i3
      if i2 < 0 or i1 < 0 or i0 < 0: continue
      e0 = n/(i1+i2+i3)
      dp2[i3][i2] += dp[i3][i2] * i1/(i1+i2+i3)
      ans += dp[i3][i2] * e0*(i1/(i1+i2+i3))
      if i2 > 0:
        dp2[i3][i2-1] += dp[i3][i2] * i2/(i1+i2+i3)
        ans += dp[i3][i2] * e0*(i2/(i1+i2+i3))
      if i3 > 0 and i2 < n2+n3:
        dp2[i3-1][i2+1] += dp[i3][i2] * i3/(i1+i2+i3)
        ans += dp[i3][i2] * e0*(i3/(i1+i2+i3))
  dp = dp2

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from functools import lru_cache

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

d = collections.Counter(a)
s = sum(a)
n1, n2, n3 = d[1], d[2], d[3]

@lru_cache(maxsize=None)
def calc(i1, i2, i3):
  if i1 == i2 == i3 == 0:
    return 0

  ex = n/(i1+i2+i3)
  if i1 > 0:
    ex += calc(i1-1, i2, i3) * (i1/(i1+i2+i3))
  if i2 > 0:
    ex += calc(i1+1, i2-1, i3) * (i2/(i1+i2+i3))
  if i3 > 0:
    ex += calc(i1, i2+1, i3-1) * (i3/(i1+i2+i3))

  return ex

print(calc(n1, n2, n3))

Buggy submission (verdict: Runtime Error):
import collections
from functools import lru_cache

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

d = collections.Counter(a)
s = sum(a)
n1, n2, n3 = d[1], d[2], d[3]

@lru_cache(maxsize=None)
def calc(i1, i2, i3):
  if i1 == i2 == i3 == 0:
    return 0

  ex = n/(i1+i2+i3)
  if i1 > 0:
    ex += calc(i1-1, i2, i3) * (i1/(i1+i2+i3))
  if i2 > 0:
    ex += calc(i1+1, i2-1, i3) * (i2/(i1+i2+i3))
  if i3 > 0:
    ex += calc(i1, i2+1, i3-1) * (i3/(i1+i2+i3))

  return ex

print(calc(n1, n2, n3))
Problem p02909 (python)

Fixed submission:
d = {'Sunny':1, 'Cloudy':2, 'Rainy':0}
l = ['Sunny', 'Cloudy', 'Rainy']

input_s = input()

output_s = l[d[input_s]]

print(output_s)

Buggy submission (verdict: Runtime Error):
N, K, Q = [int(x) for x in input().split(' ')]
points = [0 for x in range(N)]

for q in range(Q):
  index = int(input())-1
  points[index] += 1

for n in range(N):
  print('Yes' if (Q-points[n]) < K else 'No')
Problem p02921 (python)

Fixed submission:
forecast = input()
actual = input()
count = 0
 
for i in range(len(forecast)):
  if forecast[i] == actual[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
forecast = input()
actual = input()
count = 0

for i in range(len(forecast)):
  if forcast[i] == actual[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
forecast = input()
actual = input()
count = 0

for i in range(len(forecast)):
  if forcast[i] = actual[i]:
    count += 1
print(count)
Problem p03101 (python)

Fixed submission:
length, width = input().split()
length, width = int(length),int(width)
x, y = input().split()
x,y = int(x),int(y)
 
print((length-x) * (width-y))

Buggy submission (verdict: Runtime Error):
length, width = int(input()).split()
x, y = int(input()).split()

print((length-x) * (width-y))
Problem p02910 (python)

Fixed submission:
s=input()

i=0
flug=0
for x in range(1,len(s)+1):
    if(x%2==1):
        if(s[x-1] =='L'):
            flug=1
            break
    else:
        if(s[x-1] =='R'):
            flug=1
            break

if(flug==1):
    print("No")
else:
    print("Yes")

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

i=0
flug=0
for x in range(1,len(s)+1):
    if(x%2==1):
        if(s[x] =='L'):
            flug=1
            break
    else:
        if(s[x] =='R'):
            flug=1
            break

if(flug==1):
    print("No")
else:
    print("Yes")
Problem p02911 (python)

Fixed submission:
N,K,Q = list(map(int, input().split()))



a=[]
nScore=[]

for x in range(N):
    nScore.append(0)

for x in range(Q):
    nScore[int(input())-1]+=1

# if(K>Q):
#     for x in range(N):
#         print("Yes")

for x in range(N):
    if K-Q+nScore[x]>0:
        print("Yes")
    else:
        print("No")

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

a=[]
nScore=[]
for x in range(Q):
    a.append(input())

for x in range(N):
    nScore.append(K)

for x in range(Q):
    ＃print("----Scores-----")
    
    for y in range(N)#
        if(y+1 !=int(a[x])):
            nScore[y]-=1
            #print("{}: {}".format(y,str(nScore[y])))
        else:
            #print("{}: {} Scored".format(y,str(nScore[y])))

for x in range(N):
    if(nScore[x]<=0):
        print("No")
    else:
        print("Yes")
Problem p03005 (python)

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

if N > K and K !=1:
	wide = N - K
elif N == K or K==1:
  	wide = 0
else:
    wide = 0
    
print(wide)

Buggy submission (verdict: Runtime Error):
i=True
while i:
  
  N,K=map(int,input().split())
  
  if N > K:
  
  	wide = N - K
  
  elif N = K:
    
    wide = 0
    
  else:
    
    wide = 1
    
print(wide)

Buggy submission (verdict: Runtime Error):
i=True

while i:
  
  N,K=map(int,input().split())
  
  if N > K:
  
  	wide = N - K
  
  elif N = K:
    
    wide = 0
    
  else:
    
    wide = 1
    
  print(wide)

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

if N > K:
  
  wide = N - K
  
elif N = K:
  
  wide = 0
  
else:
  wide = 1
  
print(wide)
Problem p02909 (python)

Fixed submission:
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
elif s == 'Rainy':
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
elif s == 'Rainy'
  print('Sunny')

Buggy submission (verdict: Runtime Error):
def getweather(s):
  if s == 'Sunny':
    return 'Cloudy'
  elif s == 'Cloudy':
    return 'Rainy'
  elif s == 'Rainy'
    return 'Sunny'

s = input()
getweather(s)