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

Fixed submission:
s=input()
if len(s)%2==0:
  for i in range(len(s)//2):
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
if len(s)%2==1:
  for i in range(len(s)//2):
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
  for i in range(len(s)//2+1):
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
if len(s)%2==0:
  for i in range(len(s)//2):
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
if len(s)%2==1:
  for i in range(len(s)//2+1):
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)//2+1):
  if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
    print('No')
    exit()
for i in range(len(s)//2):
  if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
    print('No')
    exit()
if len(s)%2==1:
  if s[-1]!='L' and s[-1]!='U' and s[-1]!='D':
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)//2+1):
  if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
    print('No')
    exit()
  if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
    print('No')
    exit()
if 
print('Yes')
Problem p02911 (python)

Fixed submission:
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
point=[-k]*n
for i in range(q):
  point[a[i]-1]+=1
for i in range(n):
  if point[i]>-2*k+q:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>-2*k+q:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>-2k+q:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
if q<k:
  print(0)
  exit()
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>-q:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
if q<k:
  print(0)
  exit()
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>=0:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
if q<k:
  print(0)
  exit()
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>0:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
if q<k:
  print(0)
  exit()
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point(i)>0:
    print('Yes')
  else:
    print('No')
Problem p02923 (python)

Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=0
while 1:
    for k in range(a,n-1):
        if h[k]>=h[k+1] :
            ans+=1
            a+=1
        else:
            ans1.append(ans)
            ans=0
            a+=1
            break
    if a>=n-1:
        ans1.append(ans)
        break
print(max(ans1))

Buggy submission (verdict: Runtime Error):
n=int(input())
h[int(i) for i in input().split()]
ans=0
ans1=[]
a=0
while 1:
    for k in range(a,n-1):
        if h[k]>=h[k+1] :
            ans+=1
            a+=1
        else:
            ans1.append(ans)
            ans=0
            a+=1
            break
    if a>=n-1:
        ans1.append(ans)
        break
print(max(ans1))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=1
for i in range(a,n-1):
  for k in range(i,n-1):
    if h[k]>=h[k+1]:
      ans+=1
      a+=1
    else:
      ans1.append(ans)
      ans=0
      break
print(max(ans1))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=1
for i in range(a,n-1):
  for k in range(i,n):
    if h[k]>=h[k+1]:
      ans+=1
      a+=1
    else:
      ans1.append(ans)
      ans=0
      break
print(max(ans1))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=0
for i in range(a,n-1):
  for k in range(i,n-1):
    a=0
    if h[k]>=h[k+1]:
      ans+=1
      a+=1
    else:
      ans1.append(ans)
      ans=0
      break
print(max(ans1))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=0
for i in range(n-2):
  for k in range(i+1+a,n-1):
    a=0
    if h[i]>=h[i+1]:
      ans+=1
      a+=1
    else:
      ans1.append(ans)
      ans=0
      break
print(max(ans1))
Problem p02947 (python)

Fixed submission:
n=int(input())
ans=0
dic={}
for _ in range(n):
    s=input()
    s=sorted(s)
    s=''.join(s)
    if not s in dic.keys():
      dic[s]=1
    else: dic[s]+=1
for i in dic.values():
  ans+=i*(i-1)//2


print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input()
ans=0
dic={}
for _ in range(n):
    s=input()
    s=sorted(s)
    s=''.join(s)
    if not s in dic.keys():
      dic[s]=1
    else: dic[s]+=1
for i in dic.values():
  ans+=i*(i-1)//2


print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for _ in range(n)]
ans=0
dic={}
for i in range(n):
    a=s[i].sort()
    if not a in dic.keys():
      dic[a]=1
    else: dic[a]+=1
for i in dic.values():
  ans+=i*(i-1)//2


print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for _ in range(n)]
ans=0
dic=dict()
for i in range(n):
    lst=sorted(list(s[i]))
    if dic[lst]:
      dic[lst]=1
    else: dic[lst]+=1
for i in dic.values():
  ans+=i*(i-1)

    
print(ans)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
if a==b:
  print(0)
elif (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=b:
  print(0)
elif (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')
Problem p02958 (python)

Fixed submission:
n=int(input())
p=[int(i) for i in input().split()]
n1=[i for i in range(1,n+1)]
for i in range(n):
  for k in range(n):
    n1[i],n1[k]=n1[k],n1[i]
    if n1==p:
      print('YES')
      exit()
    n1=[i for i in range(1,n+1)]
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[int(i) for i in input().split()]
n1=[i for i in range(1,n+1)]
for i in n1:
  for k in n1:
    n1=n1.replace(i,k)
    if n1==p:
      print('YES')
      exit()
else:
  print('NO')
Problem p02983 (python)

Fixed submission:
l,r=map(int,input().split())
min1=2018
if r-l>=2018:
  print(0)
  exit()
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      min1=min(i*j%2019,min1)
print(min1)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
min1=2018
if r-l>=2018:
  print(0)
  exit()
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      min=min(i*j%2019,min1)
print(min1)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
if r-l>=2018:
  print(0)
  exit()
min1=2018
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      min=min(i*j%2019,min1)
print(min1)
Problem p02994 (python)

Fixed submission:
n,l=map(int,input().split())
a=n*(2*l+n-1)//2
if 1-n<=l<=0:
  print(a)
elif l<=-n:
  print(a-l-n+1)
else :
  print(a-l)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
 a=n*(2*l+n-1)//2
if 1-n<=l<=0:
  print(a)
elif l<=-n:
  print(a-l-n+1)
else :
  print(a-l)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
if 1-n<=l<=0:
  a=n*(2*l+n-1)//2
  print(a)
elif l<=-n:
  print(a-l-n+1)
else :
  print(a-l)
Problem p02995 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if d>c:
  euclid2,euclid1=c,d
  e1,e2=euclid1,euclid2
  while not euclid2==0:
    euclid1=euclid1%euclid2
    euclid1,euclid2=euclid2,euclid1
    cd=c*d//euclid1
else:
  euclid2,euclid1=d,c
  e1,e2=euclid1,euclid2
  while not euclid2==0:
    euclid1=euclid1%euclid2
    euclid1,euclid2=euclid2,euclid1
    cd=c*d//euclid1
  
c1=(a-1)//c+1
c2=(b-c1*c)//c+1
d1=(a-1)//d+1
d2=(b-d1*d)//d+1
cd1=(a-1)//cd+1
cd2=(b-cd1*cd)//cd+1  
print(b-a+1-c2-d2+cd2)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if d>c:
  euclid2,euclid1=c,d
  e1,e2=euclid1,euclid2
  while not euclid2==0:
    euclid1=euclid1%euclid2
    euclid1,euclid2=euclid2,euclid1
    cd=c*d//euclid1
if c>d:
  euclid2,euclid1=d,c
  e1,e2=euclid1,euclid2
  while not euclid2==0:
    euclid1=euclid1%euclid2
    euclid1,euclid2=euclid2,euclid1
    cd=c*d//euclid1
  
c1=(a-1)//c
c2=(b-c1*c)//c+1
d1=(a-1)//d+1
d2=(b-d1*d)//d+1
cd1=(a-1)//cd+1
cd2=(b-cd1*cd)//(c*d)+1  
print(b-a+1-c2-d2+max(0,cd2))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if c>b and d>b:
  print(b-a+1)
  exit()
elif c>b:
  for i in range(b):
    if d*i>=a:
      d1=i*d
  print(b-a-(b-d1)//d)
  exit()
elif d>b:
  for i in range(b):
    if c*i>=a:
      c1=i*c
  print(b-a-(b-c1)//c)
  exit()
else :
  clst=[c*i for i in range(a//c+1,(b-c*i)//c+i+1)]    
  dlst=[d*i for i in range(a//c+1,(b-d*i)//d+i+1)]
  lst=set(clst+dlst)
  print(b-a+1-len(lst))
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
d=0
ans=0
for i in l:
  if d+i>x:
    print(ans+1)
    exit()
  ans+=1
  d+=i
print(ans+1)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=[int(i) for i in input()split()]
a=0
ans=0
for i in l:
  if a+i>x:
    print(ans+1)
    exit()
  ans+=1
  a+=i
print(ans)
Problem p03147 (python)

Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
j=0
ans=0
while j<max(h):
  if h[0]>j:
    ans+=1
  for i in range(1,n):
    if h[i-1]<=j and h [i]>j:
      ans+=1
  j+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[int(i) for i input().split()]
j=0
ans=0
while True:
  if h[0]>j:
    ans+=1
  for i in range(1,n):
    if h[i-1]<=j and h [i]>j:
      ans+=1
  j+=1
  if j==max(h):
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n=ini(input())
h=[int(i) for i input().split()]
j=0
ans=0
while True:
  if h[0]>j:
    ans+=1
  for i in range(1,n):
    if h[i-1]<=j and h [i]>j:
      ans+=1
  j+=1
  if j==max(h):
    break
print(ans)
Problem p03160 (python)

Fixed submission:
def main():
	N = int(input())
	h = list( map(int, input().split()) )
	
	dp = [0 for _ in range(N)]
	dp[1] = abs(h[0] - h[1])
	for i in range(2, N):
		dp[i] = min( dp[i-1] + abs(h[i] - h[i-1]),
		             dp[i-2] + abs(h[i] - h[i-2]) )
	print(dp[N-1])

	return

main()

Buggy submission (verdict: Runtime Error):
import functools as fun

@fun.lru_cache(maxsize = None)
def rec(n):
	if n == 0:
		return 0
	elif n == 1:
		return abs(h[n] - h[n-1])
	else:
		return min(rec(n-1) + abs(h[n] - h[n-1]), rec(n-2) + abs(h[n] - h[n-2]))


### main

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

print(rec(N-1))

Buggy submission (verdict: Runtime Error):
import functools as fun

@fun.lru_cache
def rec(n):
	if n == 0:
		return 0
	elif n == 1:
		return abs(h[n] - h[n-1])
	else:
		return min(rec(n-1) + abs(h[n] - h[n-1]), rec(n-2) + abs(h[n] - h[n-2]))

### main
N = int(input())
h = list(map(int, input().split()))

print(rec(N-1))
Problem p03720 (python)

Fixed submission:
n,m=list(map(int,input().split()))
lists=[]
for i in range(n):
  lists.append(0)
for i in range(m):
  am,bm=list(map(int,input().split()))
  lists[am-1]+=1
  lists[bm-1]+=1
for i in range(n):
  print(lists[i])

Buggy submission (verdict: Runtime Error):
n,m=list(map(int,input().split()))
lists=[]
for i in range(n):
  lists.append()
for i in range(n):
  am=int(input())
  bm=int(input())
  lists[am-1]+=1
  lists[bm-1]+=1
for i in range(n):
  print(str(list[i])+"\n")
Problem p02841 (python)

Fixed submission:
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 in [1, 3, 5, 7, 8, 10, 12]:
	if D1 == 31:
		print("1")
	else:
		print("0")
elif M1 == 2:
	if D1 == 28:
		print("1")
	else:
		print("0")
else:
	if D1 == 30:
		print("1")
	else:
		print("0")

Buggy submission (verdict: Runtime Error):
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if M1 in [1, 3, 5, 7, 8, 10, 12]:
	if D1 == 31:
		print("1")
	else:
		print("0")
else if M1 == 2:
	if D1 == 28:
		print("1")
	else:
		print("0")
else:
	if D1 == 30:
		print("1")
	else:
		print("0")
Problem p02845 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
H = [0] * 3
P = 1
for i in A:
	if H.count(i) == 0:
		P = 0
		break
	P *= H.count(i)
	P %= 1000000007
	H[H.index(i)] += 1
print(P)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
H = [0] * 3
P = 1
for i in A:
	P *= H.count(i)
	P %= 1000000007
	H[H.index(i)] += 1
print(P)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
H = [0] * 3
P = 1
for i in A:
	P *= H.count(i)
	H[H.index(i)] += 1
print(P % 1000000007)
Problem p02841 (python)

Fixed submission:
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())
if D2==1:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x=int(input())
ans=0
for i in range(1000):
   if i*100<=x<=105*i:
       ans=1
print(ans)
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
i=a+b
j=a-b
k=a*b
biggest=[i,j,k]
biggest_1=sorted(biggest)
print(biggest_1[-1])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split();print(max(a+b,a-b,a*b)))
Problem p03814 (python)

Fixed submission:
import re

r = re.compile(r"A.*Z")
print(max(map(len, r.findall(input()))))

Buggy submission (verdict: Runtime Error):
import re
print(max(map(len, re.findall("A.*Z",input())))
Problem p03852 (python)

Fixed submission:
print("vowel" if input() in ("a", "i", "u", "e", "o") else "consonant")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
for i in range(h):
    str = input()+"\n"
    print(str*2)
Problem p02842 (python)

Fixed submission:
N=int(input())

X=int(N/1.08)
if int(X*1.08)==N:
    print(X)
elif int((X+1)*1.08)==N:
    print(X+1)
else:
    print(":(")

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

X=int(N/1.08)
if int(X*1.08)==N:
    print(X)
else
    print(":(")
Problem p03544 (python)

Fixed submission:
import sys

N = int(input())

L0=2
L1=1

temp=L1
for i in range(N-1):
	temp=L0+L1
	L0=L1
	L1=temp
print(temp)

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())

L0=2
L1=1

for i in range(N-1):
	temp=L0+L1
	L0=L1
	L1=temp
print(temp)
Problem p03547 (python)

Fixed submission:
import sys

S = input().split()

if ord(S[0])<ord(S[1]):
	print("<")
elif ord(S[0])>ord(S[1]):
	print(">")
else:
	print("=")

Buggy submission (verdict: Runtime Error):
S = raw_input().split()

if ord(S[0])<ord(S[1]):
	print("<")
elif ord(S[0])>ord(S[1]):
	print(">")
else:
	print("=")
Problem p02841 (python)

Fixed submission:
n = []
for i in range(2):
    n.append(list(map(int, input().split())))
    
if n[1][1] == 1:
    print("1")
else:
    print("0")

Buggy submission (verdict: Runtime Error):
import datetime

M,D = map(int,input().split())
tdy = datetime.date(2019, M, D)
tmr = now + datetime.timedelta(days=1)

if tmr.day == 1:
    print("1")
else:
    print("0")
Problem p03229 (python)

Fixed submission:
n = int(input())
nums = []
for _ in range(n):
    nums.append(int(input()))

nums.sort()
# 奇数は2通り
# w型とm型
if n % 2 == 1:
    w = -2*sum(nums[:n//2])+nums[n//2]+nums[n//2+1]+2*sum(nums[n//2+2:])
    m = -2*sum(nums[:n//2-1])-nums[n//2-1]-nums[n//2]+2*sum(nums[n//2+1:])
    print(max(w,m))
# 偶数は1通り
else:
    print(-2*sum(nums[:n//2-1])-nums[n//2-1]+nums[n//2]+2*sum(nums[n//2+1:]))

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = []
for _ in range(n):
    nums.append(int(input()))

sorted(nums)
min_num = -1
max_num = -1

# 最大値
ans_right = nums.pop()
# 最小値
ans_left = nums.pop(0)
ans = abs(ans_right - ans_left)

while len(nums) > 2:
    num_max = nums[-1]
    num_min = nums[0]
    compare = [
        abs(num_max-ans_right),
        abs(num_max-ans_left),
        abs(num_min-ans_right),
        abs(num_min-ans_left)
    ]
    t = max(compare)
    c = compare.index(t)

    # 追加処理
    ans += t
    add_to_ans = num_max if c == 0 else num_min
    nums.remove(add_to_ans)
    if c % 2 == 0:
        ans_right = add_to_ans
    else:
        ans_left = add_to_ans

# add len(nums) == 1
print(ans + max(abs(nums[0]-ans_right),abs(nums[0]-ans_left)))

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = []
for _ in range(n):
    nums.append(int(input()))

sorted(nums)
min_num = -1
max_num = -1

# 最大値
ans_right = nums.pop()
# 最小値
ans_left = nums.pop(0
ans = abs(ans_right - ans_left)

while len(nums) > 2:
    num_max = nums[-1]
    num_min = nums[0]
    compare = [
        abs(num_max-ans_right),
        abs(num_max-ans_left),
        abs(num_min-ans_right),
        abs(num_min-ans_left)
    ]
    t = max(compare)
    c = compare.index(t)

    # 追加処理
    ans += t
    add_to_ans = num_max if c == 0 else num_min
    nums.remove(add_to_ans)
    if c % 2 == 0:
        ans_right = add_to_ans
    else:
        ans_left = add_to_ans

# add len(nums) == 1
print(ans + max(abs(nums[0]-ans_right),abs(nums[0]-ans_left)))
Problem p03231 (python)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

L = N*M // gcd(N,M)

n = L // N
m = L // M

list_n = [i for i in range(0,L,n)]
list_m = [i for i in range(0,L,m)]

list_common = sorted(list(set(list_n) & set(list_m)))

for i in list_common:
    if i == 0:
        if S[0] != T[0]:
            print('-1')
            exit()
    elif S[i//n] != T[i//m]:
        print('-1')
        exit()

print(L)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M = map(int,input().split())
S = input()
T = input()

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
 

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

L = N*M // gcd(N,M)

X = np.zeros(L, dtype=np.str)

for i in range(N):
    X[i*(L//N)] = S[i]

for i in range(M):
    if X[i*(L//M)] == '':
        X[i*(L//M)] = T[i]
    elif X[i*(L//M)] != T[i]:
        print('-1')
        exit()

print(L)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
N,M = map(int,input().split())
S = input()
T = input()

L = N*M // math.gcd(N,M)

X = np.zeros(L, dtype=np.str)

for i in range(N):
    X[i*(L//N)] = S[i]

for i in range(M):
    if X[i*(L//M)] == '':
        X[i*(L//M)] = T[i]
    elif X[i*(L//M)] != T[i]:
        print('-1')
        exit()

print(L)
Problem p03455 (python)

Fixed submission:
a,b = [int(i) for i in input().split()]
if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a*b % 2 == 0:
    print('Even')
else:
    print('Odd')
Problem p03729 (python)

Fixed submission:
a,b,c = input().split()
print('YES' if a[-1] == b[0] and b[-1] == c[0] else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print('YES' if a[-1] == b[0] and b[-1] == c[0] else 'NO')
Problem p02841 (python)

Fixed submission:
m, d = map(int, raw_input().split())
raw_input()
if m in (1,3,5,7,8,10,12) and d == 31:
  print(1)
elif m in (4,6,9,11) and d == 30:
  print(1)
elif m == 2 and d == 28:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
m, d = map(int, raw_input().split())
raw_input()
if m in (1,3,5,7,8,10,12) and d == 31:
  print(1)
elif m in (4,6,9,11) and d == 30:
  print(1)
elif m == 2 and d == 28:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
m, d = map(int, raw_input().split())
if m in (1,3,5,7,8,10,12) and d == 31:
  print(1)
elif m in (4,6,9,11) and d == 30:
  print(1)
elif m == 2 and d == 28:
  print(1)
else:
  print(0)
Problem p04047 (python)

Fixed submission:
n = raw_input()
l = raw_input().split()
print(sum(sorted(map(int,l), reverse=True)[1::2]))

Buggy submission (verdict: Runtime Error):
n = raw_input()
l = raw_input().split()
print(sum(sorted(l, reverse=True)[1::2]))
Problem p03071 (python)

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

if A > B: print(2*A-1)
elif A == B: print(2*A)
else: print(2*B-1)

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

if A >= B: print(2*A)
elif: print(2*B)
Problem p02899 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

l = [0] * N

for i, a in enumerate(A):
    l[int(a - 1)] = str(i + 1)
print(*l)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]

import pandas as pd
a = pd.DataFrame({'a': A})
a.index = range(1, N + 1)
b = a.sort_values('a')
l = b.index.tolist()
print(*l)
Problem p02924 (python)

Fixed submission:
N = int(input())
ans = ((N - 1) * N ) // 2
print(ans)

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

l = []
l1 = []
for i in range(1, N + 1):
    l.append(i)
for i in range(2, N + 1):
    l1.append(i)
l1.append(1)

m = []
for i in range(len(l)):
    m.append(l[i] % l1[i])
pirnt(sum(m))
Problem p02981 (python)

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

L = [T, B]
print(min(L))

Buggy submission (verdict: Runtime Error):
T = N * A

L = [T, B]
min(L)
Problem p02999 (python)

Fixed submission:
x, a = map(int, input().split())
if x < a :
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
for i in range(n):
    if d <= x:
        d += l[i]
    else:
        break
print(i)
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
c = 1
for i in l:
    d += i
    if d <= x:
        c += 1
    else:
        break
print(c)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
n = n - 1
l_d = []
d = 0
i = 0
l_d.append(d)
d = d + l[i]
while (d <= x) & (i <= n):
    l_d.append(d)
    i += 1
    d = d + l[i]
print(len(l_d))

Buggy submission (verdict: Runtime Error):
d, x = map(int, input().split())
l = list(map(int, input().split()))

l_d = []
d = 0
i = 0
while d <= x:
    l_d.append(d)
    d = d + l[i]
    i += 1
print(len(l_d))

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

X = 0
count = 0
while X <= x:
    X = X + l[count]
    count += 1
print(count)
Problem p02841 (python)

Fixed submission:
def main():
  M = []
  D = []
  for i in range(2):
    m, d = [int(i) for i in input().split()]
    M.append(m)
    D.append(d)

  if (M[0] != M[1]):
    print(1)
  else:
    print(0)

main()

Buggy submission (verdict: Runtime Error):
def main():
  M = []
  D = []
  for i in range(2):
    m, d = [int(i) for i in input().split()]
    M.append(m)
    D.append(d)

  if (M[0] != M[1]):
    print(1)
  else:
	print(0)

if __name__ == "__main__":
  main()