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

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

id = [0 for _ in range(n)]
for i in range(len(a)):
	id[a[i]-1] += 1

for i in id:
	print(i)

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

id = [0 for _ in range(n)]
for i in range(len(a)):
	id[a[i]-1] += 1

for i in id:
	print(i
Problem p02779 (python)

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

b = list(set(a))
if len(a)== len(b):
	print('YES')
else:
	print('NO')

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

b = len(set(a))
if len(a)== len(b):
	print('YES')
else:
	print('NO')
Problem p02831 (python)

Fixed submission:
A,B = map(int,input().split())
c = [0 for _ in range(1+max(A,B))]

ans = 1
#AとBで割り切れるような自然数を求める
# 2 <= ans <= A*B
def prime(n):
	res = [0 for _ in range(n+1)]
	for i in range(2,int(n**0.5)+1):
		while n%i == 0:
			res[i] += 1
			n = n//i
	if n != 1:
		res[n] = 1
	return res
a = prime(A)
b = prime(B)
for i in range(1+max(A,B)):
	if len(a)<=i:
		c[i] = b[i]
	elif len(b)<=i:
		c[i] = a[i]
	else:
		c[i] = max(a[i],b[i])


for i in range(1,len(c)):
	ans *= i**c[i]

print(ans)

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

a,b = map(int,input().split())
print(a*b//gcd(a,b))

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

a,b = map(int,input().split())
print(a*b//gcd(a,b))
Problem p02881 (python)

Fixed submission:
N = int(input())
a,b = 0,0
t = 10**13
for i in range(1,int(N**0.5)+1):
	if N%i == 0:
		if t >= N//i + i:
			t = N//i + i
			


print(t-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = []
for i in range(N):
	if i**2 > N:
		left = (i-1)
		break

for i in reversed(range(N)):
	if i**2 <N:
		right = (i-1)
		break
print(left,right)
left,right=right,left

for i in range(left**2,right**2+1):
	if N%i==0:
		ans.append(i+N//i-2)

print(min(ans))
Problem p03041 (python)

Fixed submission:
import sys
n = list(map(int, input().split()))
s = list(input())
for i in range(len(s)):
    if i == n[1]-1:
        print(s[i].lower(),end='')
        continue
    print(s[i],end='')

Buggy submission (verdict: Runtime Error):
import sys
n = list(map(int, input().split()))
s = list(input())
for i in s:
    if i == n[1]:
        print(s[i].lower(),end='')
        break
    print(s[i],end='')
Problem p02688 (python)

Fixed submission:
from collections import Counter
N, K = map(int, input().split())
list=[]
for _ in range(1,K+1):
    d = int(input())
    S = input().split()
    list.extend(S)
num = Counter(list)
print(N-len(num))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
list=[]
for _ in range(K):
    d = int(input())
    S = input().split()
    list.extend(S)
num = collections.Counter(list)
print(N-num)
Problem p02777 (python)

Fixed submission:
S = input().split()
num = [int(x) for x in input().split()]
A = input()
 
if A == S[0]:
  num[0]=num[0]-1
else:
  num[1]= num[1]-1
  
print(str(num[0])+" "+str(num[1]))

Buggy submission (verdict: Runtime Error):
A, B= input().split()
num = [int(x) for x in input().split()]
C = input()

if C == A:
  num[0]=num[0]-1
else:
  num[1]= num[1]-1
  
print(num[0]+" "+num[1])
Problem p02779 (python)

Fixed submission:
N = input()
A = input().split()
if int(N) == len(set(A)):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
A = input().split()
if n in A:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
A = input().split()
if n in A:
  print("YES")
else:
  print("NO")
N = int(input())
A = [int(x) for x in input().split()]

if n in A:
  print("YES")
else:
  print("NO")
提出情報
提出日時

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

if n in A:
  print("YES")
else:
  print("NO")
Problem p02897 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N= input()
N = int(N)
x = -( - N // 2) / N
print(x)

Buggy submission (verdict: Runtime Error):
import math
A,B = [int(i) for i in input().split()] 
 
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
list_a = prime_factorize(A)
list_b = prime_factorize(B)
list_a = set(list_a)
list_b = set(list_b)
ans = [x for x in list_a if x in list_b]
print(len(ans)+1)
Problem p02785 (python)

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

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

sum = 0
a.sort()
#print(a)
for i in range(min(n,k)): a.pop()
#print(a)
for i in range(len(a)):
    sum += a[i]
print(sum)

Buggy submission (verdict: Runtime Error):
str = input().split()
#print(str)
n = int(str[0])
k = int(str[1])
a = list(map(int, input().split()))
sum = 0
a.sort()
for i in range(k):a.pop()
#print(a)
for i in range(n-k):
    sum += a[i]
print(sum)
Problem p02831 (python)

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

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

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

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

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

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数
Problem p02989 (python)

Fixed submission:
import statistics
import math
n = int(input()) 
s = list(map(int,input().split()))
s.sort()

med_ind = len(s)//2 -1
#print(med_ind)
ans = s[med_ind+1]-s[med_ind]
#print(s[med_ind+1],s[med_ind])
print(ans)

Buggy submission (verdict: Runtime Error):
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1
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())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))
Problem p02954 (python)

Fixed submission:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import bisect
import sys
import logging
import heapq
logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)

def main():
    S=input()

    mode="L"
    start=0
    base=0
    end=0
    group=[]
    for i in range(len(S)):
        s=S[i]
        if mode=="L" and s==mode:
            mode="R"
            base=i-1
        elif mode=="R" and s==mode:
            mode="L"
            end=i-1
            group.append((start,base,end))
            start=i
        elif s=="\n":
            end=i-1
            group.append((start,base,end))
    # print(group)

    A=[0 for _ in range(len(S)-1)]
    for g in group:
        s=g[0]
        b=g[1]
        e=g[2]
        l=e-s+1
        if l//2==0:
            A[b]=A[b+1]=l/2
        else:
            A[b]=(b-s)//2+(e-b)//2+1
            A[b+1]=l-A[b]
    
    print(*A)

main()

Buggy submission (verdict: Runtime Error):
from sys import exit,setrecursionlimit
input = sys.stdin.readline

setrecursionlimit(1000000)

def main():
    S=input()

    A=[0]*(len(S)-1)
    mode="L"
    s=0
    b=0
    e=0
    l=0
    for i in range(len(S)):
        c=S[i]
        if mode=="L" and c==mode:
            mode="R"
            b=i-1
        elif mode=="R" and c==mode:
            mode="L"
            e=i-1

            calc(A,s,b,e)
            
            s=i
        elif c=="\n":
            e=i-1
            calc(A,s,b,e)

    print(*A)

def calc(A, s, b, e):
    l=e-s+1

    A[b]=(b-s)//2+(e-b)//2+1
    A[b+1]=l-A[b]

main()
Problem p02829 (python)

Fixed submission:
a=input()
b=input()
l=["1","2","3"]
l.remove(a)
l.remove(b)
print(l[0])

Buggy submission (verdict: Runtime Error):
a,b=input().split()
l=["1","2","3"]
l.remove(a)
l.remove(b)
print(l[0])
Problem p02753 (python)

Fixed submission:
S=list(input())

if S[0] == S[1]:
        if S[1] == S[2]:
                print("No")
        else:
                print("Yes")
else:
        print("Yes")

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

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

Times = N // (A + B)
rest = N - Times * (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

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

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

ALL=A+B

cnt=0
num=N
while True:
        num = num - ALL
        if num > 0:
                cnt += 1
        else:
                break

if ALL - num > A:
        ans = A * cnt + A
else:
        ans = A * cnt + ALL - num

print(ans)

Buggy submission (verdict: Runtime Error):
import sys

args=sys.argv
S=args[1]
if S[0] == S[1]:
        if S[1] == S[2]:
                print("No")
        else:
                print("Yes")
else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
#!~/anaconda3/bin/python

import sys

args=sys.argv
S=args[1]
if S[0] == S[1]:
        if S[1] == S[2]:
                print("No")
        else:
                print("Yes")
else:
        print("Yes")
Problem p02754 (python)

Fixed submission:
N, A, B = [int(x) for x in input().strip().split()]

Times = N // (A + B)
rest = N - Times * (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

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

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

Times = N // (A + B)
rest = N - Times * (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

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

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

Times = N // (A + B)
rest = N % (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

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

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

ALL=A+B
times=N//ALL
rest=N%ALL

if A < rest:
        ans=A*times+A
else:
        ans=A*times+rest

print(ans)
Problem p02984 (python)

Fixed submission:
n = int(raw_input())
A = map(int,raw_input().split())
S = 0
inv = [1,-1]*(n//2) + [1]
for q in range(n):
  S += A[q]*inv[q]
ans = [0]*n
for q in range(n):
  ans[q] = S
  S = 2*A[q]-S
print ' '.join(map(str, ans))

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
A = map(int,raw_input().split())
S = 0
inv = [1,-1]*(n//2) + [1]
for q in range(n):
  S += A[q]*inv1[q]
ans = [0]*n
for q in range(n):
  ans[q] = S
  S = 2*A[q]-S
print ' '.join(map(str, ans))
Problem p03013 (python)

Fixed submission:
n,m = map(int,raw_input().split())
a = []
buf = -111
for q in range(m):
  a.append(int( raw_input() ))
  buf = a[q]
  if buf - a[q] == 1:
    print 0
    exit(0)

if n==1:
  print 1
  exit(0)
if n==2:
  if m==1:
    print 1
    exit(0)
  if m==0:
    print 2
    exit(0)

now = [-1]*100001

if m == 0:
  now[0] = 1
  now[1] = 1
  for q in range(2,n+1):
    now[q] = (now[q-1] + now[q-2]) % 1000000007
  print now[q] % 1000000007
  exit(0)
    
now[0] = 1
if a[0] == 1: now[1] = 0
else: now[1] = 1

for q in a:
  now[q] = 0

for q in range(2,n+1):
  if now[q] != -1: continue
  now[q] = (now[q-1] + now[q-2]) % 1000000007
  
print now[q] % 1000000007

Buggy submission (verdict: Runtime Error):
n,m = map(int,raw_input().split())
a = []
buf = -111
for q in range(m):
  a.append(int( raw_input() ))
  buf = a[q]
  if buf - a[q] == 1:
    print 0
    exit(0)

now = [0]*100001

if m == 0:
  now[0] = 1
  now[1] = 1
  for q in range(2,n+1):
    now[q] = (now[q-1] + now[q-2]) % 1000000007
  print now[q] % 1000000007
  exit(0)
    
now[0] = 1
if a[0] == 1: now[1] = 0
else: now[1] = 1

for q in range(2,n+1):
  if q in a: continue
  now[q] = (now[q-1] + now[q-2]) % 1000000007
  
print now[q] % 1000000007

Buggy submission (verdict: Runtime Error):
n,m = map(int,raw_input().split())
a = []
buf = -111
for q in range(m):
  a.append(int( raw_input() ))
  if buf - a[q] == 1:
    print 0
    exit(0)

now = [0]*100001
now[0] = 1
if a[0] == 1: now[1] = 0
else: now[1] = 1

for q in range(2,n+1):
  if q in a: continue
  now[q] = now[q-1] + now[q-2]
  
print now[q] % 1000000007
Problem p03329 (python)

Fixed submission:
n = int(raw_input())

ans = 100000

d = []

for a in range(1,7):d.append( 6**a )
for a in range(1,6):d.append( 9**a )
d.append(1)
d.sort()
#print d

dp = [1000000000] * 100001
dp[0] = 0
for x in range(0,n+1):
  for y in d:
    if x-y >= 0:
      dp[x] = min( dp[x-y] + 1, dp[x] )

print dp[n]

Buggy submission (verdict: Runtime Error):
n = int(raw_input())

ans = 100000

d = []

for a in range(1,7):d.append( 6**a )
for a in range(1,6):d.append( 9**a )
d.append(1)
d.sort()
#print d

dp = [1000000000] * 100000
dp[0] = 0
for x in range(0,n+1):
  for y in d:
    if x-y >= 0:
      dp[x] = min( dp[x-y] + 1, dp[x] )

print dp[n]

Buggy submission (verdict: Runtime Error):
n = int(raw_input())

ans = 100000

d = []

for a in range(1,7):d.append( 6**a )
for a in range(1,6):d.append( 9**a )
d.append(1)
d.sort()
print d

dp = [1000000000] * 100000
dp[0] = 0
for x in range(0,n+1):
  for y in d:
    if x-y >= 0:
      dp[x] = min( dp[x-y] + 1, dp[x] )

print dp[n]
Problem p03804 (python)

Fixed submission:
data = raw_input()

n,m = map(int,data.split(" "))

data = []

for x in range(n):
  data.append(raw_input())

temp = []

for x in range(m):
  temp.append(raw_input())

for x in range(n-m+1):
  for y in range(n-m+1):
    if temp[0] == data[x][y:y+m]:
      flag = 1
      pos = y
      for xx in range(x+1,x+m):
        if temp[xx - x] != data[xx][pos:pos+m]:
          flag = 0
          break
      if flag == 1:
        print "Yes"
        exit(0)

print "No"

Buggy submission (verdict: Runtime Error):
data = raw_input()

n,m = map(int,data.split(" "))

data = []

for x in range(n):
  data.append(raw_input())

temp = []

for x in range(m):
  temp.append(raw_input())

for x in range(n):
  for y in range(n):
    if temp[0] == data[x][y:y+m]:
      flag = 1
      pos = y
      for xx in range(x+1,x+m):
        if temp[xx - x] != data[xx][pos:pos+m]:
          flag = 0
          break
      if flag == 1:
        print "Yes"
        exit(0)

print "No"
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
s = int(input())
if a >= 3200:
        print(s)
else:
        print("red")
Problem p03250 (python)

Fixed submission:
data = input().split()
print(int(sorted(data)[2] + sorted(data)[1]) + int(sorted(data)[0]))

Buggy submission (verdict: Runtime Error):
data = input().split()
data = data.sort()
print(data[2]+data[1])

Buggy submission (verdict: Runtime Error):
data = input().split()
print(data.sort()[2]+data.sort()[1])
Problem p03315 (python)

Fixed submission:
from sys import stdin
S = str(stdin.readline().rstrip())
i = 0
takahasi = 0
while i < 4:
  if S[i:i+1] == "+":
    takahasi += 1
  elif S[i:i+1] == "-":
    takahasi -= 1
  i += 1
print(takahasi)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = str(stdin.readline().rstrip())
i = 0
takahasi = 0
while i < 4:
  if S[i:i+1] == "+":
    takahasi += 1
  elif S[i:i+1] == "-":
    takahasi -= 1
  i += 1
print(takahasi)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = stdin.readline().rstrip()
i = 0
wa = 0
while i < len(str(N)):
    wa = wa + int(str(N)[i:i+1])
    i += 1
if N % wa == 0:
    print("Yes")
elif N % wa != 0:
    print("No")

Buggy submission (verdict: Runtime Error):
i = 0
takahasi = 0
while i < 4:
  if S[i:i+1] == "+":
    takahasi += 1
  elif S[i:i+1] == "-":
    takahasi -= 1
  i += 1
print(takahasi)

Buggy submission (verdict: Runtime Error):
i = 0
takahasi = 0
while i < 4:
  if S[i:i+1] == "+":
    takahasi += 1
  else:
    takahasi -= 1
  i += 1
print(takahasi)

Buggy submission (verdict: Runtime Error):
i = 0
takahasi = 0
while i < 4:
    if S[i:i+1] == "+":
        takahasi += 1
    else:
        takahasi -= 1
    i += 1
print(takahasi)
Problem p02689 (python)

Fixed submission:
n,m = list(map(int,input().split()))
h = list(map(int,input().split()))

 # 要素n が全てTrueの配列
good = [True] * n
for im in range(m):
    a,b = list(map(int,input().split()))
    if h[a-1] > h[b-1]:
        good[b-1] = False
    elif h[b-1] > h[a-1]:
        good[a-1] = False
    else:
        good[a-1] = False
        good[b-1] = False

#count(x) リスト中のxの数を返す
print(good.count(True))

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

 # 要素n が全てTrueの配列
good = [True] * n
for im in range(m):
    a,b = list(map(int,input().split()))
    if h[a-1] > h[b-1]:
        good[b] = False
    elif h[b-1] > h[a-1]:
        good[a-1] = False
    else:
        good[a-1] = False
        good[b-1] = False

#count(x) リスト中のxの数を返す
print(good.count(True))

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

aPrev=0
a,b=0,0
count=0

good = [True] * n # 要素n が全てTrueの配列
for im in range(m):
    a,b = list(map(int,input().split()))
    if h[a-1] > h[b-1]:
        good[b] = False
    elif h[b-1] > h[a-1]:
        good[a-1] = False
    else:
        good[a-1] = False
        good[b-1] = False

print(good.count(True)) #count(x) リスト中のxの数を返す
Problem p02753 (python)

Fixed submission:
def main():
    S =input()

    if S[0] == S[1] and S[0] == S[2]:

        print("No")
    else :
        print("Yes")


main()

Buggy submission (verdict: Runtime Error):
def main():
    S =list(map(int,input().split()))
    if S[0] == S[1] and S[0] == S[2]:
        print("No")
    else :
        print("Yes")


main()

Buggy submission (verdict: Runtime Error):
def main():
    S =list(map(int,input().split()))
    if S[0] == S[1] and S[0] == S[2]
        print("No")
    else 
        print("Yes")


main()
Problem p02790 (python)

Fixed submission:
a,b=input().split()
if int(a)>int(b):
  print(b*int(a))
else:
  print(a*int(b))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if int(a)>int(b):
  print(b*str(a))
else:
  print(a*str(b))
Problem p02881 (python)

Fixed submission:
from math import sqrt

n=int(input())
for i in range(int(sqrt(n)),1,-1):
  if n%i==0:
    print(i-1 + n//i-1)
    break
else:
  print(n-1)

Buggy submission (verdict: Runtime Error):
from math import sprt

n=int(input())
for i in range(int(sqrt(n)),2,-1):
  if n%i==0:
    print(i-1 + int(n/i)-1)
    break
else:
  print(n-1)

Buggy submission (verdict: Runtime Error):
from math import sprt

n=int(input())
for i in range(int(sqrt(n)),2,-1):
  if n%i==0:
    print(i-1 + n//i-1)
    break
else:
  print(n-1)
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 p02951 (python)

Fixed submission:
a,b,c=map(int,input().split())
ans=b+c-a
if ans<0:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
ans
ans=a-(b+c)
if ans<0:
  ans=0
print(ans)
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r*r)

Buggy submission (verdict: Runtime Error):
r = int(input("long?"))

return r * r
Problem p02860 (python)

Fixed submission:
N = int(input())
A = str(input())

if (N % 2 == 0):
  if (A[:N//2] == A[N//2:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if (N % 2 == 0):
  if (A[:N/2] == A[N/2:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if (N % 2 == 0):
  if (A[0:N/2-1] == A[N/2:N-1]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if (N % 2 == 0):
  if (A[:N/2-1] == A[N/2:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if (N % 2 == 0):
  if (A[:N/2-1] == A[N/2:N-1]):
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02860 (python)

Fixed submission:
if __name__=='__main__':
    N = int(input())
    S = input()
    ans = 'No'
    if N % 2 == 0:
        if S[0:int(N/2)]==S[int(N/2):]: ans='Yes'
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__=='__main__':
    N = int(input())
    S = input()
    ans = 'No'
    if N % 2 == 0:
        if S[0:N/2]==S[N/2:]: ans='Yes'
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__=='__main__':
    N = int(input())
    S = input()
    ans = 'No'
    if N % 2 == 0 and S[0:N/2]==S[N/2:]: ans='Yes'
    print(ans)
Problem p02725 (python)

Fixed submission:
def getIntList(inp):
	return [int(_) for _ in inp]


from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs

def main(inputs):
	k,n=getIntList(inputs[0])
	aList=getIntList(inputs[1])
	
	d=k-aList[n-1]+aList[0]
	di=n-1
# 	print(d,di)
	for ai in range(n-1):
		dd=aList[ai+1]-aList[ai]
# 		print(dd)
		if dd>d:
			di=ai
			d=dd
	
	print(k-d)


if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)

Buggy submission (verdict: Runtime Error):

from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs

def main(inputs):
	k,n=getIntList(inputs[0])
	aList=getIntList(inputs[1])
	
	d=k-aList[n-1]+aList[0]
	di=n-1
# 	print(d,di)
	for ai in range(n-1):
		dd=aList[ai+1]-aList[ai]
# 		print(dd)
		if dd>d:
			di=ai
			d=dd
	
	print(k-d)


if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)
Problem p02699 (python)

Fixed submission:
s, w =[int(i) for i in input().split()]
if w >= s:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
s = input()
len_s = len(s)
ans = 0
for i in range(len_s):
    for j in range(i + 3 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
len_s = len(s)
ans = 0
for i in range(len_s):
    for j in range(i + 4 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
len_s = len(s)
ans = 0
for i in range(len_s - 3):
    for j in range(i + 4 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
len_s = len(s)
ans = 0
for i in range(len_s - 4):
    for j in range(i + 4 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
print(6 - a - b)

Buggy submission (verdict: Runtime Error):
a = int(input)
b = int(input)
print(6 - a - b)
Problem p02699 (python)

Fixed submission:
import sys
import math


def main():
    input = sys.stdin.readline
    a, b = (int(i) for i in input().split())
    if a <= b:
        print("unsafe")
    else:
        print("safe")


main()

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


def main():
    input = sys.stdin.readline
    a, b = (int(i) for i in input().split())
    if a <= b:
        print("unsafe")
    else:
        print("safe)


main()
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r**2)

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

if a >= 10 or b >= 10:
  print(-1)
else:
  print(a*b)