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

Fixed submission:
A, B = map(int, input().split())
def calc(A, B):
  Amin = A/0.08
  if (Amin - int(Amin)) != 0.:
    Amin = int(Amin)+1
  else:
    Amin = int(Amin)
  Amax = int((A+1)/0.08)
  Arange = set(range(Amin, Amax))
  Bmin = B/0.1
  if (Bmin - int(Bmin)) != 0.:
    Bmin = int(Bmin)+1
  else:
    Bmin = int(Bmin)
  Bmax = int((B+1)/0.1)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  print(-1) if len(intersection) == 0 else print(min(intersection))
calc(A, B)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
def calc(A, B):
  Amin = A/0.08
  
  if (Amin - int(Amin)) != 0.:
    Amin = int(Amin)+1
  
  Amax = int((A+1)/0.08)
  Arange = set(range(Amin, Amax))
  Bmin = B/0.1
  if (Bmin - int(Bmin)) != 0.:
    Bmin = int(Bmin)+1
  Bmax = int((B+1)/0.1)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  if len(intersection) == 0:
    print(-1) 
  else:
    print(min(intersection))
calc(A, B)

Buggy submission (verdict: Runtime Error):
A, B = input().split()
def calc(A, B):
  Amin = int(A/0.08)
  Amax = int((A+1)/0.08+0.001)
  Arange = set(range(Amin, Amax))
  Bmin = int(B/0.1)
  Bmax = int((B+1)/0.1+0.001)
  Brange = set(range(Bmin, Bmax))
  intersection = Arange & Brange
  if len(intersection) == 0:
    print(-1) 
  else:
    print(min(intersection))
calc(A,B)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
Amin = A/0.08
Amax = int((A+1)/0.08)+1
Arange = set(range(Amin, Amax))
Bmin = B/0.1
Bmax = int((B+1)/0.1)+1
Brange = set(range(Bmin, Bmax))
intersection = Arange & Brange
if len(intersection) > 0:
  print(min(intersection))
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
Amin = A//0.08
Amax = A+1//0.08
Arange = set(range(Amin, Amax+1))
Bmin = B//0.1
Bmax = B+1//0.1
Brange = set(range(Bmin, Bmax+1))
intersection = Arange & Brange
print(min(intersection))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
Amin = A//0.08
Amax = A//0.1
Arange = set(range(Amin, Amax))
Bmin = B//0.08
Bmax = B//0.1
Brange = set(range(Bmin, Bmax))
intersection = Arange & Brange
print(min(intersection))
Problem p02760 (python)

Fixed submission:
import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
        sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
s = []
a = [[s.append(i) for i in line.split(" ")] for line in input().split()]
nums = []
[[nums.append(num) for num in row.split(" ")] for row in s[:9]]
n = int(s[9])
bs = s[10:]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

Buggy submission (verdict: Runtime Error):
s = input().split()
nums = []
[[nums.append(num) for num in row.split(" ")] for row in s[:9]]
n = int(s[9])
bs = s[10:]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

Buggy submission (verdict: Runtime Error):
s = input().split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
patterns = [[1, 2, 3],
            [1, 5, 9],
            [1, 4, 7],
            [2, 5, 8],
            [3, 5, 7],
            [3, 6, 9],
            [4, 5, 6],
            [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

Buggy submission (verdict: Runtime Error):
s = input().split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
             [1, 5, 9],
             [1, 4, 7],
             [2, 5, 8],
             [3, 5, 7],
             [3, 6, 9],
             [4, 5, 6],
             [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
s = input.split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
                [1, 5, 9],
                [1, 4, 7],
                [2, 5, 8],
                [3, 5, 7],
                [3, 6, 9],
                [4, 5, 6],
                [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
Problem p02724 (python)

Fixed submission:
x = int(input())
bigpleasure = (x//500)*1000
smallpleasure = ((x%500)//5)*5

print(bigpleasure+smallpleasure)

Buggy submission (verdict: Runtime Error):
x = input()
bigpleasure = x//500*1000
smallpleasure = x%500//5*5

print(bigpleasure+smallpleasure)
Problem p02755 (python)

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

Amin = A/0.08
if Amin != int(Amin):
  Amin = int(Amin)+1
else:
  Amin = int(Amin)

Bmin = B/0.1
if Bmin != int(Bmin):
  Bmin = int(Bmin)+1
else:
  Bmin = int(Bmin)

rangea = set(range(Amin,int((A+1)/0.08),1))
rangeb = set(range(Bmin,int((B+1)/0.10),1))

intersection = rangea & rangeb

if len(intersection)==0:
  print(-1)
else:
  print(min(intersection))

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

Amin = A/0.08
if Amin != int(Amin):
  Amin = int(Amin)+1
else Amin = int(Amin)

Bmin = B/0.1
if Bmin != int(Bmin):
  Bmin = int(Bmin)+1
else Bmin = int(Bmin)

rangea = set(range(Amin,int((A+1)/0.08),1))
rangeb = set(range(Bmin,int((B+1)/0.10),1))

intersection = rangea & rangeb

if len(intersection)==0:
  print(-1)
else:
  print(min(intersection))

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

Amin = A/0.08
if Amin != int(Amin):
  Amin = int(Amin)+1

Bmin = B/0.1
if Bmin != int(Bmin):
  Bmin = int(Bmin)+1

rangea = set(range(Amin,int((A+1)/0.08),1))
rangeb = set(range(Bmin,int((B+1)/0.10),1))

intersection = rangea & rangeb

if len(intersection)==0:
  print(-1)
else:
  print(min(intersection))
Problem p02761 (python)

Fixed submission:
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, m = map(int, input().split())
S = []
C = []
for i in range(m):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)
for i in range(1000):
    d = list(str(i))
    if len(d) != n:
        continue
    else:
        judge = True
        for i in range(m):
            if d[S[i]-1] != str(C[i]):
                judge = False
        if judge:
            print("".join(d))
            exit()
print(-1)

Buggy submission (verdict: Runtime Error):
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, m = map(int, input().split())
S = []
C = []
for i in range(m):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)
ans = [0, 0, 0]
for i in range(m):
    ans[S[i]-1] = C[i]
if n == 3 and ans[0] == 0:
    print(-1)
    exit()
if n == 2 and ans[1] == 0:
    print(-1)
    exit()
if n == 3:
    print("".join(map(str, ans[:n])))
elif n == 2:
    print("".join(map(str, ans[1:3])))
elif n == 1:
    print("".join(map(str, ans[2])))

Buggy submission (verdict: Runtime Error):
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, m = map(int, input().split())
S = []
C = []
for i in range(m):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)
ans = [0, 0, 0]
for i in range(m):
    ans[S[i]-1] = C[i]
if n == 2 and ans[1] == 0:
    print(-1)
    exit()
if n == 3:
    print("".join(map(str, ans[:n])))
elif n == 2:
    print("".join(map(str, ans[1:3])))
elif n == 1:
    print("".join(map(str, ans[2])))
Problem p02813 (python)

Fixed submission:
n=int(input())
#s=list(input().split())
#s,t=list(input().split())
#a=list(map(int,input().split()))
#k,x=map(int,input().split())
p=list(input().split())
q=list(input().split())
p=[int(i) for i in p]
q=[int(i) for i in q]
import itertools
import math
p_index,q_index=0,0
fulllist=list(itertools.permutations([i for i in range(1,n+1)]))
for i in range(math.factorial(n)):
    if p==list(fulllist[i]):
        p_index=i+1
    if q==list(fulllist[i]):
        q_index=i+1
print(abs(p_index-q_index))

Buggy submission (verdict: Runtime Error):
n=int(input())
#s=list(input().split())
#s,t=list(input().split())
#a=list(map(int,input().split()))
#k,x=map(int,input().split())
p=list(input().split())
q=list(input().split())
p=[int(i) for i in p]
q=[int(i) for i in q]
import itertools
import math
fulllist=list(itertools.permutations([i for i in range(1,n+1)]))
for i in range(math.factorial(n)):
    if p==list(fulllist[i]):
        p_index=i+1
    elif q==list(fulllist[i]):
        q_index=i+1
print(abs(p_index-q_index))

Buggy submission (verdict: Runtime Error):
n=int(input())
#s=list(input().split())
#s,t=list(input().split())
#a=list(map(int,input().split()))
#k,x=map(int,input().split())
p=list(map(int,input()))
q=list(map(int,input()))
import itertools
import math
fulllist=list(itertools.permutations([i for i in range(1,n+1)]))
for i in range(math.factorial(n)):
    if p==fulllist[i]:
        p_index=i+1
    elif q==fulllist[i]:
        q_index=i+1
print(abs(p_index-q_index))
Problem p02882 (python)

Fixed submission:
a,b,x=map(int,input().split())
import math
ab=a*b
s=x/a
h=(ab-s)*2/a
if ab/2<=s:
    print(math.degrees(math.atan2(h,a)))
else:
    w=s*2/b
    print(math.degrees(math.atan2(b,w)))

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[]
total=0
for i in range(n,0,-1):
    p.append(i)
p.reverse()
for i in range(1,n):
    total+=i%p[i]
print(total)
Problem p02885 (python)

Fixed submission:
#n=int(input())
a,b=map(int,input().split())
#n,k=map(int,input().split())
#H=list(map(int,input().split()))
c=a-2*b
print(max(c,0))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
#n,k=map(int,input().split())
#H=list(map(int,input().split()))
print(max(a-2*b),0)
Problem p02923 (python)

Fixed submission:
#a,b=map(int,input().split())
#p_3,p_4=map(int,input().split())
n=int(input())
#S=input()
#T=input()
#recipe=[list(input().split())for _ in range(n)]
#m=int(input())
#have=[list(input().split())for _ in range(m)]
#s=[list(input())for _ in range(n)]
h=list(map(int,input().split()))
#v=list(map(int,input().split()))
#c=list(map(float,input().split()))
#n=int(input())
#s=[list(map(int,input().split()))for _ in range(n)]
#s=[list(input().split())for _ in range(n)]
#s=[input()for _ in range(n)]
h.reverse()
cnt=0
ans=0
for i in range(1,n):
    if h[i-1]<=h[i]:
        cnt+=1
    else:
        cnt=0
    ans=max(ans,cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
#a,b=map(int,input().split())
#p_3,p_4=map(int,input().split())
n=int(input())
#S=input()
#T=input()
#recipe=[list(input().split())for _ in range(n)]
#m=int(input())
#have=[list(input().split())for _ in range(m)]
#s=[list(input())for _ in range(n)]
h=list(map(int,input().split()))
#v=list(map(int,input().split()))
#c=list(map(float,input().split()))
#n=int(input())
#s=[list(map(int,input().split()))for _ in range(n)]
#s=[list(input().split())for _ in range(n)]
#s=[input()for _ in range(n)]
h.reverse()
cnt=0
ans=[]
for i in range(n-1):
    if h[i]<=h[i+1]:
        cnt+=1
    else:
        ans.append(cnt)
        cnt=0
print(max(max(ans),0))

Buggy submission (verdict: Runtime Error):
#a,b=map(int,input().split())
#p_3,p_4=map(int,input().split())
n=int(input())
#S=input()
#T=input()
#recipe=[list(input().split())for _ in range(n)]
#m=int(input())
#have=[list(input().split())for _ in range(m)]
#s=[list(input())for _ in range(n)]
h=list(map(int,input().split()))
#v=list(map(int,input().split()))
#c=list(map(float,input().split()))
#n=int(input())
#s=[list(map(int,input().split()))for _ in range(n)]
#s=[list(input().split())for _ in range(n)]
#s=[input()for _ in range(n)]
h.reverse()
cnt=0
ans=[]
for i in range(n-1):
    if h[i]<=h[i+1]:
        cnt+=1
    else:
        ans.append(cnt)
        cnt=0
print(max(ans))
Problem p02952 (python)

Fixed submission:
n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
ans=0
for i in range(1,n+1):
        if len(str(i))%2==1:
                ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
ans=0
for i in range(1,n+1):
        if len(str(i))=1:
                ans+=1
print(ans)
Problem p02982 (python)

Fixed submission:
n,d=map(int,input().split())
x=[list(map(int,input().split()))for _ in range(n)]
ans=0
for i in range(n-1):
    for j in range(1,n-i):
        l=0
        for k in range(d):
            l+=(x[i][k]-x[i+j][k])**2
        l=l**0.5
        if l.is_integer()==True:
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,d=map(int,input().split())
x=[list(map(int,input().split()))]
ans=0
for i in range(n-1):
    for j in range(1,n-i):
        l=0
        for k in range(d):
            l+=(x[i][k]-x[i+j][k])**2
        l=l**0.5
        if l.is_integer()==True:
            ans+=1
print(ans)
Problem p03000 (python)

Fixed submission:
import bisect
n,x=map(int,input().split())
L=list(map(int,input().split()))
a=[0]*(n+1)
for i in range(1,n+1):
    a[i]=a[i-1]+L[i-1]
for i in range(n+1):
    if x==a[i]:
        print(bisect.bisect_right(a,x))
        exit()
print(bisect.bisect_left(a,x))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
p=0
ans=1
for i in range(n):
        p+=L[i]
        ans+=1 if p<=x else continue
print(ans)
Problem p03006 (python)

Fixed submission:
import sys
N = int(input())
arr = []

for i in range(N):
    arr.append(list(map(int, input().split())))

if N == 1:
    print(1)
    sys.exit()

d = {}

for i in range(N):
    for j in range(N):
        if i != j:
            x = arr[i][0] - arr[j][0]
            y = arr[i][1] - arr[j][1]
            if (x, y) in list(d.keys()):
                d[(x, y)] += 1
            else:
                d[(x, y)] = 1

print(N - max(list(d.values())))

Buggy submission (verdict: Runtime Error):
n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
        x[i],y[i]=list(map(int,input().split()))
diff=[[0,0]for i in range(n-1)]
for i in range(n-1):
        diff[i][0]=x[i+1]-x[i]
        diff[i][1]=y[i+1]-y[i]
ans=[]
for i in range(n-1):
        ans.append(diff.count(diff[i]))
print(n-max(ans))
Problem p03037 (python)

Fixed submission:
n,m=map(int,input().split())
L=[0]*m
R=[0]*m
for i in range(m):
    l,r=map(int,input().split())
    L[i],R[i]=l,r
ans=min(R)-max(L)+1
print(max(ans,0))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
L=[]
R=[]
for i in range(m):
    l,r=map(int,input().split())
    L[i],R[i]=l,r
print(abs(max(L)-min(R)+1)
Problem p03061 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
L=[0]*(n+1)
R=[0]*(n+1)
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
for i in range(n):
    L[i+1]=gcd(L[i],A[i])
for i in range(n,0,-1):
    R[i-1]=gcd(R[i],A[i-1])
ans=[]
for k in range(n):
    ans.append(gcd(L[k],R[k+1]))
print(max(ans))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
A=list(map(int,input().split()))
L=[0]*(n+1)
R=[0]*(n+1)
for i in range(n):
    L[i+1]=math.gcd(L[i],A[i])
for i in range(n,0,-1):
    R[i-1]=math.gcd(R[i],A[i-1])
ans=[]
for k in range(n):
    ans.append(math.gcd(L[k],R[k+1]))
print(max(ans))
Problem p03076 (python)

Fixed submission:
A=list(int(input())for i in range(5))
ans=0
num=0
com=0
for a in A:
    if a%10==0:
        ans+=a
    else:
        tmp=10-a%10
        ans+=(a//10+1)*10
        if com<tmp:
            com=tmp
            num=a
if num==0:
    print(ans)
else:
    ans-=(num//10+1)*10
    ans+=num
    print(ans)

Buggy submission (verdict: Runtime Error):
A=list(int(input())for i in range(5))
com=0
num=-1
for i in range(5):
    if A[i]%10==0:
        continue
    else:
        rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
if len(A)!=0:
    A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
ans+=tmp
print(ans)

Buggy submission (verdict: Runtime Error):
A=list(int(input())for i in range(5))
com=0
for i in range(5):
    if A[i]%10==0:
        continue
    else:
        rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
ans+=tmp
print(ans)

Buggy submission (verdict: Runtime Error):
A=list(int(input())for i in range(5))
com=0
for i in range(5):
    if A[i]%10==0:
        continue
    rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
ans+=tmp
print(ans)
Problem p03086 (python)

Fixed submission:
s=list(input())
n=len(s)
ans=0
tmp=-10
cnt=[0]*20
for i in range(n):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        cnt[i]=1
for i in cnt:
    if i==1:
        ans+=1
    else:
        if tmp<ans:
            tmp=ans
            ans=0
if tmp==-10:
    print(ams)
else:
    print(tmp)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
cnt=[]
for i in s:
    if i=="A" or i=="C" or i=="G" or i=="T":
        ans+=1
    else:
        cnt.append(ans)
        ans=0
print(max(cnt))
Problem p03089 (python)

Fixed submission:
n=int(input())
B=list(map(int,input().split()))
flag=True
ans=[]
while flag and len(B):
    for i in range(len(B)-1,-1,-1):
        if B[i]==i+1:
            del B[i]
            ans.append(i+1)
            break
    else:
        flag=False
        break
if not flag:
    print(-1)
else:
    for i in range(len(ans)-1,-1,-1):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
B=list(map(int,input().split()))
flag=True
ans=[]
while flag and len(B):
    for i in range(len(B)-1,-1,-1):
        if B[i]==i+1:
            del B[i]
            ans.append(i+1)
            break
    else:
        flag=False
        break
if not flag:
    print(-1)
else:
    for anse in ans[::-1]
        print(anse)
Problem p03146 (python)

Fixed submission:
n=int(input())
a=[n]
while True:
    if n%2==0:
        n//=2
    else:
        n=3*n+1
    if n in a:
        print(len(a)+1)
        exit()
    a.append(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
cnt=[0]*300
cnt[n-1]=1
i=1
while True:
    if n%2==0:
        n//=2
    else:
        n=3*n+1
    i+=1
    if cnt[n-1]==1:
        print(i)
        exit()
    cnt[n-1]=1
Problem p03231 (python)

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
n,m=map(int,input().split())
s=list(input())
t=list(input())
g=gcd(n,m)
a=n//g
b=m//g
judge=True
for i in range(g):
    if s[a*i]!=t[b*i]:
        judge=False
        break
print(g*a*b) if judge else print(-1)
#print(len(text))

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
n,m=map(int,input().split())
s=list(input())
t=list(input())
L=lcm(n,m)
text=["0"]*L
judge=True
for i in range(n):
    text[i*(L//n)]=s[i]
for j in range(m):
    if text[j*(L//m)]!="0":
        if text[j*(L//m)]!=t[j]:
            judge=False
print(L) if judge else print(-1)
#print(len(text))

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
n,m=map(int,input().split())
max_num=max(n,m)
s=list(input())
t=list(input())
L=lcm(n,m)
text=["0"]*(L*max_num)
judge=True
for i in range(n):
    text[i*(L//n)]=s[i]
for j in range(m):
    if text[j*(L//m)]!="0" and text[j*(L//m)]!=t[j]:
        judge=False
print(L) if judge else print(-1)
#print(len(text))
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
    print("Hello World")
else:
    a=input()
    b=input()
    print(int(a)+int(b))

Buggy submission (verdict: Runtime Error):
n=list(input())
if n==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
Problem p03243 (python)

Fixed submission:
n=list(input())
temp=""
temp=temp.join(map(str,n))
temp=int(temp)
if n[0]==n[1]==n[2]:
    temp=""
    temp=temp.join(map(str,n))
    temp=int(temp)
    print(temp)
else:
    a=n[0]*3
    a=int(a)
    b=(str(int(n[0])+1))*3
    b=int(b)
    if a<temp:
        print(b)
    else:
        print(a)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=111;i<=999;i+=111){
        if(N<=i){
            cout<<i<<endl;
            return 0;
        }
    }
}

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=100;i<=999;i+111){
        if(N<=i){
            cout<<i<<endl;
            return 0;
        }
    }
    return 0;
}
Problem p03251 (python)

Fixed submission:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a_max=max(a)
b_min=min(b)
for i in range(x+1,y+1):
    if a_max<i and i<=b_min:
        print("No War")
        exit()
print("War")

Buggy submission (verdict: Runtime Error):
//============================================================================
// Name        : HelloWorld.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<algorithm>
using namespace std;

int main() {
	int n,m,x,y;
	int X[1000],Y[1000];
	cin>>n>>m>>x>>y;
	for(int i=0;i<n;i++){
		cin>>X[i];
	}
	for(int j=0;j<m;j++){
		cin>>Y[j];

	}
	int X_max=-1000;
	int Y_min=1000;
	for(int i=0;i<n;i++){
		if(X_max<X[i]){
			X_max=X[i];
		}
	}
	for(int j=0;j<m;j++){
		if(Y[j]<Y_min){
			Y_min=Y[j];
		}
	}

	for(int k=x;k<y;k++){
		if(X_max<=k && k<=Y_min){
			cout<<"No War"<<endl;
			return 0;
		}

	}
	cout<<"War"<<endl;



}
Problem p03281 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1,2):
    cnt=0
    for j in range(1,n+1):
        if i%j==0:
            cnt+=1
    if cnt==8:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<105:
    print(0)
elif 105<=n and n<135:
    print(1)
elif 135=n and n<175:
    print(2)
elif 175<=n and n<189:
    print(3)
else:
    print(4)
Problem p03324 (python)

Fixed submission:
d,n=map(int,input().split())
if d==0:
    if n==100:
        print(n+1)
    else:
        print(n)
elif d==1:
    if n==100:
        print(100*n+100)
    else:
        print(100*n)
elif d==2:
    if n==100:
        print(n*10000+10000)
    else:
        print(n*10000)

Buggy submission (verdict: Runtime Error):
d,n=map(int,input().split())
if d==0:
    print(n)
else:
    for i in range(n+1):
        a=100**d*i
print(a)