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

Fixed submission:
n,m = map(int,input().split())
student = []
check = []
for i in range(n):
    ab = [int(i) for i in input().split()]
    student.append(ab)
for j in range(m):
    cd = [int(i) for i in input().split()]
    check.append(cd)
mn = 10**13
for ax,by in student:
    for i in range(m):
        dist = abs(ax-check[i][0]) + abs(by-check[i][1])
        if mn > dist:
            ans = i+1
            mn = dist
    print(ans)
    mn = 10**13

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
student = []
check = []
for i in range(n):
    ab = [int(i) for i in input().split()]
    student.append(ab)
for j in range(m):
    cd = [int(i) for i in input().split()]
    check.append(cd)
mn = 10**8
for ax,by in student:
    for i in range(m):
        dist = abs(ax-check[i][0]) + abs(by-check[i][1])
        if mn > dist:
            ans = i+1
            mn = dist
    print(ans)
    mn = 10**8
Problem p02754 (python)

Fixed submission:

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

sum = a+b

if n < a+b:

    if n < a :
        print(n)
    else:
        print(a)

else: 
    if n%sum > a: 
        print (((n // sum)*a) + a)

    else:
        res = ((n // sum)*a) + (n % sum)
        print(res)

Buggy submission (verdict: Runtime Error):

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

sum = a+b

if n < a+b:

    if n < a :
        print(n)
    else:
        print(a)

else: 
    if n%sum > a: 
        print ((n // sum)*a) + a

    else:
        res = ((n // sum)*a) + (n % sum)
        print(res)

Buggy submission (verdict: Runtime Error):

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

sum = a+b

if n < a+b:

    if n < a :
        print(n)
    else:
        print(a)

else:
    res = ((n // sum)*a) + (n % sum)
    
    if n%sum > a: 
        print( ((n // sum)*a) + a

    else:
        print(res)
Problem p02829 (python)

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

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(2)]
print (6-a[0]-a[1])

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(5)]
print (6-a[0]-a[1])

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

Fixed submission:

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

from fractions import gcd

res=a*b/gcd(a,b)
print(int(res))

Buggy submission (verdict: Runtime Error):

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

from fractions import gcd

res=a*b/math.gcd(a,b)
print(int(res))

Buggy submission (verdict: Runtime Error):

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

import math

res=a*b/math.gcd(a,b)
print(int(res))

Buggy submission (verdict: Runtime Error):

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

import math

print(len(a*b/math.gcd(a,b)))
Problem p02835 (python)

Fixed submission:
a = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる
if a[0]+a[1]+a[2] >= 22:
  print ("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0]+a[1]+a[2] >= 22:
  print ("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a = input().split()
if (a[0]+a[1]+a[2]) >= 22:
  print("bust")
else:
  print("win")
Problem p02847 (python)

Fixed submission:
s = input()
days = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print (days[s])

Buggy submission (verdict: Runtime Error):
s = input()
if s = "SUN":
  print (7) 
elif s= "MON":
  print (6)
elif s= "TUE":
  print (5)
elif s= "WED":
  print (4)
elif s= "THU":
  print (3)
elif s= "FRI":
  print (2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
s = input()
if s = "SUN":
  print ("7") 
elif s= "MON":
  print ("6")
elif s= "TUE":
  print ("5")
elif s= "WED":
  print ("4")
elif s= "THU":
  print ("3")
elif s= "FRI":
  print ("2")
else:
  print("1")
Problem p02859 (python)

Fixed submission:
r = int(input()) 
print (r*r)

Buggy submission (verdict: Runtime Error):
a = int(input())
bai = r*r
print(bai)

Buggy submission (verdict: Runtime Error):
r = input()
bai = r*r/1
print (bai)
Problem p02879 (python)

Fixed submission:
A, B = list(map(int,input().split()))
if A >=10 or B >=10:
  print ("-1")
else:
  print (A*B)

Buggy submission (verdict: Runtime Error):
A, B = int(input().split())
if A >=10 or B >=10:
  print ("-1")
else:
  print (A*B)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A >=10 or B >=10:
  print ("-1")
else:
  print (A*B)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
if n % 2 == 1:
	print (((n+1)/2) /n)
else:
	print ((n/2)/n)

Buggy submission (verdict: Runtime Error):
N = int(input())
if n % 2 != 0:
	print (((n+1)/2) /n)
else:
  print (2/n)
Problem p02915 (python)

Fixed submission:
n = int(input())
print (n*n*n)

Buggy submission (verdict: Runtime Error):
n=int(print())
print(n*n*n)
Problem p02753 (python)

Fixed submission:
s=input()
print('Yes' if 'A' in s and 'B' in s else 'No')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>80:
    print(-1)
elif a==b:
    if a<=3:
        print(25*a//2)
    else:
        print(-1)
else:
    if -(-25*a//2) <= 10*b and -(-25*a//2) > 9*b:
        print(25*a//2)
    else:
        print(-1)
Problem p02777 (python)

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

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

Fixed submission:
t,x = map(int,input().split())
print(t/x)

Buggy submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

Buggy submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

Buggy submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

Buggy submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if sum(l) >2*max(l) else 'No')

Buggy submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if 2*max(l)< sum(l) else 'No')

Buggy submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if max(l)*2< sum(l) else 'No')

Buggy submission (verdict: Runtime Error):
int(input())
l=list(map(int,input().split()))
print('Yes' if max(l)*2< sum(l) else 'No')
Problem p03805 (python)

Fixed submission:
import itertools
N,M=map(int,input().split())
edges={tuple(sorted(map(int,input().split()))) for i in range(M)}
ans=0
for i in itertools.permutations(range(2,N+1),N-1):
    l=[1]+list(i)
    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]
l.sort(key=lambda l:(l[0]))
c=0
used=[]
def find_num(itr,target):
    for j in range(itr, m):
        if target in l[j]:
            next_target=[k for k in l[j] if k!=target][0]
            used.append(next_target)
            if len(used) == n:
                return True
            if find_num(j,next_target):
                return True
            else:
                return False
    return False

for i in range(m):
    used=[]
    if 1 in l[i]:
        used.append(1)
        next_target = [k for k in l[i] if k != 1][0]
        used.append(next_target)
        rtn=find_num(i, next_target)
        if rtn:
            c+=1
print(c)
Problem p02987 (python)

Fixed submission:
s=input()
count1=0
count2=0

char1=s[0]
char2='1'
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif '1'==char2:
    char2=s[2]
    count2+=1
elif s[2]==char2:
    count2+=1

if s[3]==char1:
    count1+=1
elif '1'==char2:
    char2=s[3]
    count2+=1
elif s[3]==char2:
    count2+=1

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()
count1=0
count2=0

char1=s[0]
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif s[2]==char2:
    char2=s[2]
    count2+=1
else:
    print('No')
    exit()

if s[3]==char1:
    count1+=1
elif s[3]==char2:
    char2=s[3]
    count2+=1
else:
    print('No')
    exit

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')
Problem p03036 (python)

Fixed submission:
r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
	print(x)

Buggy submission (verdict: Runtime Error):
r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
    print(x)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
a, s = input().split()
if int(a) >= 3200:print(s)
else:print("red")
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))
Problem p02912 (python)

Fixed submission:
import heapq
 
N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)
 
print(-sum(A))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
t=0

for i in range(m):
    a[0]=a[0]//2
    t=a[0]
    
    if n>1:
        for j in range(m):
            if a[j]<a[j+1]:
                a[j]=a[j+1]
                a[j+1]=t
            else:
                break
    
print(sum(a))
Problem p03307 (python)

Fixed submission:
n=int(input())

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

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
    
print(lcm(2,n))
Problem p02831 (python)

Fixed submission:
import fractions

A, B = list(map(lambda x: int(x), input().split()))

print(int((A * B) / fractions.gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import math

A, B = list(map(lambda x: int(x), input().split()))

print(int((A * B) / math.gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import math

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

A, B = list(map(lambda x: int(x), input().split()))

print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

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

A, B = list(map(lambda x: int(x), input().split()))

print(lcm(A, B))
Problem p03127 (python)

Fixed submission:
import fractions
INF = 100000000000

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

min_gcd = INF

for a in range(len(lists) - 1):
  min_gcd = min(min_gcd, fractions.gcd(lists[a], lists[a+1]))

print(min_gcd)

Buggy submission (verdict: Runtime Error):
INF = 100000000000
import math
N = int(input())
lists = list(map(int, input().split()))

min_gcd = INF

for a in range(len(lists) - 1):
  min_gcd = min(min_gcd, math.gcd(lists[a], lists[a+1]))

print(min_gcd)
Problem p03295 (python)

Fixed submission:
# https://atcoder.jp/contests/abc103/tasks/abc103_d

# ToDo not yet

# biについて昇順にソートする
# それぞれのbiについて、
# 1: すでに分断されているなら何もしない
# 2: 分断されていないならbi - 1番目の橋を切断する

N, M = map(int, input().split())
demand_list = []
for _ in range(M):
    ai, bi = map(int, input().split())
    demand_list.append([ai, bi])

# ソート
demands = sorted(demand_list, key=lambda d: d[1])

# 分断開始 切断されている橋は1で表現される
# cut_bilagge_list = [0 for _ in range(N)]
cnt = 0
cut_max_len = -1

for demand in demands:
    a, b = demand
    # すでに分断されているのかをチェックする
    if a < cut_max_len:
        continue
    # if len([1 for i in cut_bilagge_list[demand[0] - 1:demand[1] - 1] if i == 1]) > 0:
    #     continue

    # 分断されていないので bi - 2の橋を切断する
    # cut_bilagge_list[demand[1] - 2] = 1
    cut_max_len = b
    cnt += 1

# print(sum(1 for bilagge in cut_bilagge_list if bilagge == 1))
print(cnt)

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc103/tasks/abc103_d

# ToDo not yet

# biについて昇順にソートする
# それぞれのbiについて、
# 1: すでに分断されているなら何もしない
# 2: 分断されていないならbi - 1番目の橋を切断する
from typing import List, Any

N, M = map(int, input().split())
demand_list = []
for _ in range(M):
    ai, bi = map(int, input().split())
    demand_list.append([ai, bi])

# ソート
demands = sorted(demand_list, key=lambda d: d[1])

# 分断開始 切断されている橋は1で表現される
cut_bilagge_list = [0 for _ in range(N)]

for demand in demands:
    # すでに分断されているのかをチェックする
    if len([1 for i in cut_bilagge_list[demand[0] - 1:demand[1] - 1] if i == 1]) > 0:
        continue

    # 分断されていないので bi - 2の橋を切断する
    cut_bilagge_list[demand[1] - 2] = 1


print(sum(1 for bilagge in cut_bilagge_list if bilagge == 1))

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc103/tasks/abc103_d

# ToDo not yet

# biについて昇順にソートする
# それぞれのbiについて、
# 1: すでに分断されているなら何もしない
# 2: 分断されていないならbi - 1番目の橋を切断する
from typing import List, Any

N, M = map(int, input().split())
demand_list = []
for _ in range(M):
    ai, bi = map(int, input().split())
    demand_list.append([ai, bi])

# ソート
demands = sorted(demand_list, key=lambda d: d[1])

# 分断開始 切断されている橋は1で表現される
cut_bilagge_list = [0 for _ in range(N)]

for demand in demands:
    # すでに分断されているのかをチェックする
    if len([1 for i in cut_bilagge_list[demand[0] - 1:demand[1] - 1] if i == 1]) > 0:
        continue

    # 分断されていないので bi - 2の橋を切断する
    cut_bilagge_list[demand[1] - 2] = 1


print(sum(1 for bilagge in cut_bilagge_list if bilagge == 1))
Problem p03253 (python)

Fixed submission:
from math import factorial

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

if M==1:
  print(1)
  exit()
MOD=(10**9)+7
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(n**0.5) + 2
    for num in range(2,tmp):
        count=0
        while n % num == 0:
            n //= num
            count+=1
        if count>0:
          factor.append(count)
    #リストが空ならそれは素数
    if not factor:
        return [1]
    elif n!=1:
        factor.append(1)
        return factor
    else:
        return factor


factor=trial_division(M)

ans=1
for a in factor:
  for i in range(a):
    ans*=N+i
  ans //= factorial(a)
  ans%=MOD

print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
MOD=(10**9)+7
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(n**0.5) + 2
    for num in range(2,tmp):
        count=0
        while n % num == 0:
            n //= num
            count+=1
        if count>0:
          factor.append(count)
    #リストが空ならそれは素数
    if not factor:
        return [1]
    elif n!=1:
        factor.append(1)
        return factor
    else:
        return factor
      
def combinations_count(n, r):
    if n==r:
      return 1
    re = combinations_count(n - 1, r) * n // (n - r)
    return re


factor=trial_division(M)

ans=1
for a in factor:
  ans*=combinations_count(a+N-1,a)
  ans%=MOD
print(ans)
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())

if N%==0:
  print(N)
else:
  print(2*N)
Problem p03745 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
before=0
state='minus'
ans=0

for i in range(N):
  if A[i]==before:
    continue
  elif A[i]-before>0:
    if state=='minus':
      ans+=1
      state='None'
    elif state=='None':
      state='plus'
  else:
    if state=='plus':
      state='None'
      ans+=1
    elif state=='None':
      state='minus'
  before=A[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
before=0
state=-1
ans=0
for a in A:
  
  if a==before:
    continue
  elif a-before>0:
    if state==-1:
      state=1
      ans+=1
    if state==0:
      state=-1
  else:
    if state==-1:
      state=0
      ans+=1
    if state==1:
      state=-1
  before=a
if (A[-1]-A[-2])*(A[-2]-A[-3])<0:
  ans+=1
print(ans)
Problem p03835 (python)

Fixed submission:
K,S = map(int,input().split())
sum=0
for x in range(0,K+1):
    for y in range(0,K+1):
        z = S-x-y

        if z>=0 and z<=K:
            sum+=1


print(sum)

Buggy submission (verdict: Runtime Error):
K,S = map(int,input().split())
sum=0
for x in range(0,K+1):
    for y in range(x,K+1):
       if x+y-S<=0:
           z = S-x-y
            
            if x==y and y==z and z==x:
              sum+=1
            elif x!=z and z!=y and y!=x:
              sum+=6
            else:
              sum+=3

print(sum)
Problem p02689 (python)

Fixed submission:
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
    count[b[i] - 1] = 1
      
print(count.count(0))

Buggy submission (verdict: Runtime Error):
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
	count[b[i] - 1] = 1
      
print(count.count(0))
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n
 
for i in range(n):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n
 
for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(int,input().split()))
 
for i in range(n):
	print(a.count(i + 1))

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

for i in range(n):
	print(a.count(i + 1))
Problem p02711 (python)

Fixed submission:
n = input()
count = 0

for i in range(3):
  if n[i] == '7':
    count += 1
    
if count > 0:
  print('Yes')
  
else:
  print('No')

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

for i in range(len(n)):
  if n[i] = '7':
    count += 1
    
if count > 0:
  print('Yes')
  
else:
  print('No')
Problem p02819 (python)

Fixed submission:
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
      x += 1
    else:
      x += 2

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

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
	  x += 1
    else:
      x += 2

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

from math import sqrt

while count == 0:
	if x % 2 == 0:
      x += 1
	else:
      x += 2
    for i in range(1, round(sqrt(x)), 2):
      if x % i == 0:
        count = 1
Problem p02831 (python)

Fixed submission:
A, B = list(map(int, input().split()))
from fractions import gcd

print(A * B // gcd(A, B))

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

from math import gcd

print(A * B / gcd(A, B))
Problem p02832 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
brick = [0]
number = 1

import sys

if min(a) > 1:
  print('-1')
  sys.exit()

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
brick = []
number = 1

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
brick = list[]
number = 1

for i in range(N):
  if a[i] == number:
	brick.append(number)
    number += 1
print(N - max(brick))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
count = 0
number = 1

for i in range(N):
  if a[i] == number:
    for j in range(i):
      count += 1
      a.pop[number - 1]
    number += 1
print(count)
Problem p02847 (python)

Fixed submission:
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else:
    print('1')

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

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else S == 'SUT':
    print('1')

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

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else S == 'SUT':
    print('1')
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:N / 2] == S[N / 2 + 1:N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:N / 2] == S[N / 2 + 1:N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0, N / 2] == S[N / 2 + 1, N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0, N / 2] == S[N / 2 + 1, N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0, N / 2] = S[N / 2, N - 1]:
    print('Yes')
else:
    print('No')
Problem p02879 (python)

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

if A[0] <= 9 and A[1] <= 9:
  print(A[0] * A[1])
else:
  print('-1')

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

if A <= 9 and B <= 9:
  print(A * B)
else:
  print('-1')
Problem p02880 (python)

Fixed submission:
import sys

N = int(input())

for i in range(9):
  for j in range(9):
    if N == (i + 1) * (j + 1):
      print('Yes')
      sys.exit()
print('No')

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

for i in range(9):
  for j in range(9):
    if N == i * j:
      print('Yes')
      return
print('No')
Problem p02881 (python)

Fixed submission:
import math

N = int(input())
a = N + 1
b = round(math.sqrt(N))

for i in range(b):
  j = i + 1
  if N % j == 0:
    if a > j + N / j:
      a = j + N / j
print(round(a) - 2)

Buggy submission (verdict: Runtime Error):
import math

c = list(map(float, input().split()))
a = c[0]
b = c[1]
x = c[2]
if x <= a * a * b / 2.0:
  print(90.0 - math.atan((x / a * 2.0 / b) / b) * 180.0 / math.pi)
else:
  print(math.atan(((a * a * b - x) / a * 2.0 / a) / a) * 180.0 / math.pi)

Buggy submission (verdict: Runtime Error):
import math
import sys

N = int(input())

for i in reversed(range(int(math.sqrt(N)))):
  if N % i == 0:
    print(i + N / i)
    sys.exit()