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

Fixed submission:
a,b=map(int,raw_input().split())
if a<b:
  print b*str(a)
else:
   print a*str(b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())
if a<b:
  print b*str(a)
else b<a:
   print b*str(a)

Buggy submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())
if a<b:
  print int(b*str(a))
else b<a:
   print int(b*str(a))
Problem p02793 (python)

Fixed submission:
import sys
from fractions import gcd
input = sys.stdin.readline

n = input()
arr = list(map(int, input().split()))
tmp = arr[0]
for i in arr:
    tmp = tmp*i//gcd(tmp,i)
print(sum(tmp//a for a in arr) % (10**9+7))

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd
input = sys.stdin.readline
def lcm(a, b):
    return a*b//gcd(a, b)

n = input()
arr = list(map(int, input().split()))
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum(tmp/a for a in arr)
ans = ans % (1e+9+7)
print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd
input = sys.stdin.readline
def lcm(a, b):
    return a*b//gcd(a, b)

n = input()
arr = map(int, input().split())
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum(tmp/a for a in arr)
ans = ans % (1e+9+7)
print(int(ans))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def lcm(a, b):
    return a*b//gcd(a, b)
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([tmp/a for a in arr])
ans = int(ans % (1e+9+7))
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
def lcm(a, b):
    return a*b//gcd(a, b)
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([tmp/a for a in arr])
ans = int(ans % (1e+9+7))
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
# arr = [12, 1, 12, 12, 12]
def gcd(a, b):
    while b is not 0:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a *b//gcd(a, b)
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([tmp/a for a in arr])
ans = int(ans % (1e+9+7))
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
arr = [a for a in arr if a!=0]
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a *b//gcd(a, b)
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([int(tmp/a) for a in arr])
ans = int(ans % (1e+9+7))
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a *b//gcd(a, b)
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([int(tmp/a) for a in arr])
ans = int(ans % (1e+9+7))
print(ans)
Problem p02793 (python)

Fixed submission:
from fractions import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))

Buggy submission (verdict: Runtime Error):
from math import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math as m
n=int(input())
a=input().split()
b=1
for i in a:
    i=int(i)
    b*=i//m.gcd(b,i)
    
print(sum(b//int(i) for i in a)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math as m
n=int(input())
a=input().split()
b=1
for i in a:
    i=int(i)
    b*=i//m.gcd(b,i)
    
print(sum(b//int(i) for i in a)%(10**9+7))
Problem p03835 (python)

Fixed submission:
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  for y in range(k+1):
    a = s - x - y
    if a >= 0 and a <= k:
      count += 1

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  for y in range(k+1):
    if x + y > s:
      break
    a = s - x - y
    if a >= 0 && a <= k:
      count += 1

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  a=s-k-x
  a=0 if a < 0
  for y in range(a,k+1):
    if x + y > s:
      break
    for z in range(k+1):
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  a = s-k-x
  a = 0 if a < 0
  for y in range(a,k+1):
    if x + y > s:
      break
    for z in num:
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  a = s-k-x
  a = 0 if a < 0 else a
  for y in range(a,k+1):
    if x + y > s:
      break
    for z in num:
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
num = range(k+1)
for x in num:
  for y in num:
    if x + Y > s:
      break:
    for z in num:
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break:

print(count)

Buggy submission (verdict: Runtime Error):
k,s = map(int,input().split())

count = 0
num = range(k+1)
for x in num:
  for y in num:
    if x + Y > s:
      break
    for z in num:
      if x + y + z == s:
        count += 1
      elif x + y + z > s:
        break

print(count)
Problem p02790 (python)

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

Buggy submission (verdict: Runtime Error):
a=list(map(lambda x:x,input().split()))
if(a[1]>a[0]):
  print(str(a[0])*a[1])
else:
  print(str(a[1])*a[0])

Buggy submission (verdict: Runtime Error):
a=list(map(lambda x:x,input(),split()))
if(a[1]>a[0]):
  print(str(a[0])*a[1])
else:
  print(str(a[1])*a[0])
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())
Q = 6-A-B

print(Q)

Buggy submission (verdict: Runtime Error):
Q = 6-A-B;
print(Q);

Buggy submission (verdict: Runtime Error):
Q = 6 - A -B
print(Q)

Buggy submission (verdict: Runtime Error):
Q = 6-A-B
print Q
Problem p02831 (python)

Fixed submission:
A = list(map(int, input().split()))
a = A[0]
b = A[1]
 
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
 
ans = a*b/gcd(a,b)
ans = int(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A = list(map(int, input().split()))
a = A[0]
b = A[1]

ans = a*b/math.gcd(a,b)
print(ans)
Problem p02832 (python)

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

c = 0
e = len(A)
d = 1
for i in range(e):
  if A[i] == d:
    d = d + 1
  else:
    c = c + 1

if c == e:
    print(-1)
else:
    print(c)

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

c = 0
e = len(A)
for i in range(e - ):
  d = 1
  if A[i] == d:
    d = d + 1
  else:
    c = c + 1

if c == e:
    print(-1)
else:
    print(c)
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a, b = map(int,input().split())

def lcm(a, b):
  return a * b // gcd (a, b)

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
from fractions import gcd


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

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

print(lcm(a, b))

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

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

print(lcm(a,b))

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

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

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

Fixed submission:
a1, a2, a3 = map(int,input().split())
 
x = a1 + a2 + a3
 
if x >= 22 :
  print("bust")
  
else :
  print("win")

Buggy submission (verdict: Runtime Error):
a1 = int(input())
a2 = int(input())
a3 = int(input())

x = a1 + a2 + a3

if x >= 22 :
  print("bust")
  
else :
  print("win")

Buggy submission (verdict: Runtime Error):
a1 = int(input())
a2 - int(input())
a3 = int(input())

x = a1 + a2 + a3

if x >= 22 :
  print("bust")
  
else :
  print("win")
Problem p02897 (python)

Fixed submission:
n = int(input())
print((n - n //2) / n)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(n - n //2) / n
Problem p03041 (python)

Fixed submission:
n, k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input(),split())
s = input()
print(s[k].lower())

Buggy submission (verdict: Runtime Error):
n, k = map(int,input(),split())
print(n[k].lower())
Problem p03075 (python)

Fixed submission:
x = [int(input()) for i in range(5)]
k = int(input())

for i in range(4):
  for _ in range(1,5):
    if abs(x[i] - x[_]) > k:
      print(":(")
      exit()
print("Yay!")

Buggy submission (verdict: Runtime Error):
x = [int(input()) for i range(5)]
k = int(input())

for i in range(4):
  for _ in range(1,5):
    if x[i] - x[_] > k:
      print(":(")
    exit()
else:
  print("Yey!")

Buggy submission (verdict: Runtime Error):
x = [int(input()) for i range(5)]
k = int(input())

for i in range(4):
  for _ in range(1,5):
    if x[i] - x[_] < k:
      print("Yey!")
    else:
      print(":(")
Problem p03077 (python)

Fixed submission:
import math
n = int(input())
l=[int(input()) for i in range(5)]
print(math.ceil(n/min(l))+4)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(5):
  l = int(input())
print(math.ceil(n/min(l))+4)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(n):
  l = int(input())
print(math.ceil(n/min(l))+4)
Problem p03242 (python)

Fixed submission:
n = list(input())
ans = ""

for i in n:
  if i == "1":
    ans += "9"
  else:
    ans += "1"
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
print(s.replace("1", "9").replace("9", "1"))
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 i = map(int,input().split())
print(n - i + 1)
Problem p03307 (python)

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

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

Fixed submission:
n = list(input())
if n[0] == n[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = list(input())
if n(0) == n(2):
  print("Yes")
else:
  print("No")
Problem p02951 (python)

Fixed submission:
while True:
    try:
        a,b,c = map(int,input().strip().split())
        print(max(b + c - a,0))
    except:
        break

Buggy submission (verdict: Runtime Error):
while True:
    a,b,c = map(int,input().strip().split())
    if(a>b+c):
        print(0)
    else:
        print(b + c - a)
Problem p02847 (python)

Fixed submission:
s = input()
w = ['SUN','MON','TUE','WED','THU','FRI','SAT']
n = [7,6,5,4,3,2,1]

for i in range(7):
  if s == w[i]:
    print(n[i])

Buggy submission (verdict: Runtime Error):
import math

a, b, x = map(int, input().split())
n = 0
i = 1
f = int(1e9)
ans = 0

while f-i > 1:
  n = (i+f)//2
  d = math.trunc(math.log10(n)) + 1
  if a*n + b*d <= x:
    i = n
  else:
    f = n

if a*f + b*d <= x:
  ans = f
elif a*i + b*d <= x:
  ans = i
else:
  ans = 0

print(ans)
Problem p02897 (python)

Fixed submission:
N = int(input())
odd = 0
 
if N % 2 == 0:
  odd = N / 2
else:
  odd = (N + 1) / 2
 
print(odd / N)

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

if N % 2 = 0:
  odd = N / 2
else:
  odd = (N + 1) / 2

print(odd / N)

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

if N % 2 = 0:
  ans = N / 2
else:
  ans = (N + 1) / 2
  
print(ans)
Problem p02847 (python)

Fixed submission:
s = input()
if s == 'SUN':
  s = 7
elif s == 'MON':
  s = 6
elif s == 'TUE':
  s = 5
elif s == 'WED':
  s = 4
elif s =='THU':
  s = 3
elif s == 'FRI':
  s = 2
elif s == 'SAT':
  s = 1
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'Sun':
  s = 0
elif s == 'MON':
  s = 1
elif s == 'TUE':
  s = 2
elif s == 'WED':
  s = 3
elif s =='THU':
  s = 4
elif s == 'FRI':
  s = 5
elif s == 'SAT':
  s = 6
print(int(s) - 0)

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'Sun':
  s = 0
elif s == 'MON':
  s = 1
elif s == 'TUE':
  s = 2
elif s == 'WED':
  s = 3
elif s =='THU':
  s = 4
elif s == 'FRI':
  s = 5
elif s == 'SAT':
  s = 6
print(s - 0)
Problem p02793 (python)

Fixed submission:
import fractions

N = int(input())
A = list(map(int, input().split()))

a = 1
for i in range(N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A = list(map(int, input().split()))

a = A[0]
for i in range(1, N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A = list(map(int, input().split()))

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000007)
print(c)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A = list(map(int, input().split()))

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000007)
print(c)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
A = list(map(int, input().split()))

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000000 + 7)
print(c)
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int,input().split())
ans = a*b//fractions.gcd(a,b)
print(ans)

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

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

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans = a*b//math.gcd(a,b)
print(ans)
Problem p02862 (python)

Fixed submission:
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

def cinit(N):
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )

X,Y = map(int, input().split())
if (X+Y)%3==0and(X<Y*2 or Y<X*2):
    cinit((X+Y)//3)
    p = (min(X,Y)*2 - max(X,Y))//3
    print(cmb((X+Y)//3,p,mod))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def cinit(N):
    g1,g2,inverse = [0]*N,[0]*N,[0]*N
    mod = 10**9+7 #出力の制限
    g1[0],g1[1],g2[0],g2[1],inverse[0],inverse[1] = 1,1,1,1,0,1 # 元テーブル
    for i in range( 2, N + 1 ):
        g1[i] = ( ( g1[-1] * i ) % mod )
        inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2[i]=( (g2[-1] * inverse[-1]) % mod )

X,Y = map(int, input().split())
if (X+Y)%3==0and(X<Y*2 or Y<X*2):
    cinit((X+Y)//3)
    p = (min(X,Y)*2 - max(X,Y))//3
    print(cmb((X+Y)//3,p,mod))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def cinit(N):
    g1,g2,g3 = [0]*N,[0]*N,[0]*N
    mod = 10**9+7 #出力の制限
    g1[0],g1[1],g2[0],g2[1],inverse[0],inverse[1] = 1,1,1,1,0,1 # 元テーブル
    for i in range( 2, N + 1 ):
        g1[i] = ( ( g1[-1] * i ) % mod )
        inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2[i]=( (g2[-1] * inverse[-1]) % mod )

X,Y = map(int, input().split())
if (X+Y)%3==0and(X<Y*2 or Y<X*2):
    cinit((X+Y)//3)
    p = (min(X,Y)*2 - max(X,Y))//3
    print(cmb((X+Y)//3,p,mod))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math
X,Y = map(int, input().split())
maxY = X * 2
if (maxY - Y)%3==0:
    num2 = (maxY - Y)//3
    num1 = X - num2 * 2
    print((math.factorial(num2+num1) // math.factorial(num1) * math.factorial(num2))%(10**9+7))
else:
    print(0)
Problem p02873 (python)

Fixed submission:
import re
s = input()
ss = re.findall(r">+|<+",s,re.S)
count = 0
num = 0
if re.findall(">",ss[0],re.S):
    count += sum(range(len(ss[0])+1))
    del ss[0]
if ss and re.findall("<",ss[-1],re.S):
    count += sum(range(len(ss[-1])+1))
    del ss[-1]
for i in range(len(ss)-1):
    if num == 0:
        num = max(len(ss[i]),len(ss[i+1]))
        count += sum(range(max(len(ss[i]),len(ss[i+1]))+1))
        count += sum(range(min(len(ss[i]),len(ss[i+1]))))
    else:
        num = 0
print(count)

Buggy submission (verdict: Runtime Error):
import re
s = input()
ss = re.findall(r">+|<+",s,re.S)
count = 0
num = 0
if re.findall(">",ss[0],re.S):
    count += sum(range(len(ss[0])+1))
    del ss[0]
if re.findall("<",ss[-1],re.S):
    count += sum(range(len(ss[-1])+1))
    del ss[-1]
for i in range(len(ss)-1):
    if num == 0:
        num = max(len(ss[i]),len(ss[i+1]))
        count += sum(range(max(len(ss[i]),len(ss[i+1]))+1))
        count += sum(range(min(len(ss[i]),len(ss[i+1]))))
    else:
        num = 0
print(count)
Problem p02831 (python)

Fixed submission:
import fractions
import sys
input = sys.stdin.readline


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    A, B = map(int, input().split())

    print(lcm(A, B))


if __name__ == "__main__":
    main()

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


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


def main():
    A, B = map(int, input().split())

    print(lcm(A, B))


if __name__ == "__main__":
    main()
Problem p03041 (python)

Fixed submission:
n, k = map(int, raw_input().split(" "))
s = raw_input()

new_s = s[:k - 1] + chr(ord(s[k - 1]) + 32) + s[k:]
print(new_s)

Buggy submission (verdict: Runtime Error):
n, k = map(int, raw_input().split(" "))
s = raw_input()

new_s = s[:k] + chr(ord(s[k]) + 32) + s[k+1:]
print(new_s)
Problem p02793 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())

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

# 最大公倍数
target_num = lcm(*a)

ans = 0
for i in range(n):
    ans += target_num//a[i]
#b = [target_num//num for num in a]

print(ans % (10**9+7))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())

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

# 最大公倍数
target_num = lcm(*a)

b = []
for i in range(n):
    b.append(target_num//a[i])

print(sum(b) % (10**9+7))
Problem p02847 (python)

Fixed submission:
string = input()
#days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

if string =="SUN":
  print(str(7))
elif string == "MON":
  print(str(6))
elif string == "TUE":
  print(str(5))
elif string == "WED":
  print(str(4))
elif string == "THU":
  print(str(3))
elif string == "FRI":
  print(str(2))
elif string == "SAT":
  print(str(1))

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

N = int(a)
S = b

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

Buggy submission (verdict: Runtime Error):
str = input()
#days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

if str =="SUN":
  print(str(7))
else if str = "MON":
  print(str(6))
else if str = "TUE":
  print(str(5))
else if str = "WED":
  print(str(4))
else if str = "THU":
  print(3)
else if str = "FRI":
  print(2)
else if str = "SAT":
  print(1)

Buggy submission (verdict: Runtime Error):
str = input()
#days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

if str =="SUN":
  print(7)
else if str = "MON":
  print(6)
else if str = "TUE":
  print(5)
else if str = "WED":
  print(3)
else if str = "THU":
  print(3)
else if str = "FRI":
  print(2)
else if str = "SAT":
  print(1)
Problem p03012 (python)

Fixed submission:
N = int(input())
S = list(map(int, input().split()))
ans = 10000

for T in range(1, N):
    s1 = 0
    s2 = 0
    for i in range(len(S)):
        if i+1 <= T:
            s1 += S[i]
        if i+1 > T:
            s2 += S[i]
    if abs(s1 - s2) < ans:
        ans = abs(s1 - s2)
        
print (ans)

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

for T in range(1, N):
    s1 = 0
    s2 = 0
    for i in range(len(S)):
        if S[i] <= T:
            s1 += S[i]
        else:
            s2 += S[i]
    if abs(s1 - s2) < ans:
        ans = abs(s1 - s2)
        
print (ans)
Problem p03013 (python)

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

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

for i in range(2, N + 2):
  if step[i] == -1:
    step[i] = 0
  else:
    step[i] = step[i - 2] + step[i - 1]

print (step[-1] % 1000000007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split(" "))
AL = list(map(int, [input() for _ in range(M)]))

# DP
dp = [1] * (N )
for A in AL:
    dp[A] = 0

for i in range(2, N):
    if dp[i] == 1:
        dp[i] = (dp[i-1] + dp[i-2]) % (10**9 + 7)
print(dp[N])

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

step = [1 for _ in range(N + 1)]
step[0] = 1
step[1] = 1

for i in A:
    dp[i] = 0

for i in range(2, N + 1):
    if step[i] == 1:
        step[i] = step[i-1] + step[i-2]

print (step[-1] % 1000000007)

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

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

for i in range(2, N + 2):
  if step[i] == -1:
    step[i] = 0
  else:
    step[i] = (step[i - 2] + step[i - 1]) % N

print (ans % 1000000007)

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

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

for i in range(2, N + 2):
  if step[i] == -1:
    step[i] = 0
  else:
    step[i] = (step[i - 2] + step[i - 1]) % N

print (ans % 1000000007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [ int(input()) for _ in range(N)]

ans = 0

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

for i in range(2, N + 2):
  if step[i] == -1:
    step[i] = 0
  else:
    step[i] = (step[i - 2] + step[i - 1]) % N

print (step[N] % 1000000007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [ int(input()) for _ in range(N)]

ans = 0

step = [0 for _ in range(N + 2)]
step[1] = 1

for _ in range(M):
  i = int(input()) + 1
  step[i] = -1

for i in range(2, N + 2):
  if step[i] == -1:
    step[i] = 0
  else:
    step[i] = (step[i - 2] + step[i - 1]) % N

print (ans % 1000000007)