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

Fixed submission:
n, m = map(int, input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        f = True
        for k in range(m):
            if a[i+k][j:j+m] != b[k]:
                f = False
                break
        if f:
            print('Yes')
            exit()

print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]
f = False
for i in range(n):
    for j in range(n):
        if a[i][j] == b[0][0]:
            for k in range(m):
                for l in range(1, m):
                    if a[i+k][j+l] != b[k][l]:
                        f = True
                        break
                if f:
                    break
            if not f:
                print('Yes')
                exit()

print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]
f = False
for i in range(n):
    for j in range(n):
        if a[i][j] == b[0][0]:
            for k in range(m):
                for l in range(1, m):
                    if a[i+k][j+l] != b[k][l]:
                        f = True
                        break
                if f:
                    break
                print('Yes')
                exit()

print('No')
Problem p03631 (python)

Fixed submission:
num=list(str(input()))
num_new=num[::-1]
if num==num_new:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
alice=[x for x in range(a,b+1)]
bob=[x for x in range(c,d+1)]
kaburi=list(set(alice) & set(bob))
if len(kaburi)<=1:
    print(0)
else:
    ans=kaburi[-1]-kaburi[0]
    print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
alice=[x for x in range(a,b+1)]
bob=[x for x in range(c,d+1)]
kaburi=list(set(alice) & set(bob))
if len(kaburi)<=1:
    print(0)
else:
    ans=kaburi[-1]-kaburi[0]
    print(ans)
Problem p03075 (python)

Fixed submission:
a = []
for i in range (5):
  a += [int(input())]
k = int(input())
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)

Buggy submission (verdict: Runtime Error):
a = []
for i in (5):
  a += [int(input())]
k = int(input())
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)

Buggy submission (verdict: Runtime Error):
a = []
for i in (5):
  a += [int(input())]
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)
Problem p03072 (python)

Fixed submission:
n = int(input())
hs = [int(h) for h in input().strip().split()]

# print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)

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

# print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)

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

print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)
Problem p03072 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
i=0
cnt=0
for j in h:
  if i<=j:
    cnt+=1
    i=j
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
i=0
cnt=0
for _ in range(n):
  j=int(input())
  if i<j:
    cnt+=1
    i=j
print(cnt)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a<=k:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>=k
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(Input())
if e-a>=k
  print('Yay!')
else:
  print(':(')
Problem p03107 (python)

Fixed submission:
s=input()
zero=0
one=0
for i in s:
  if i=="0":
    zero+=1
  elif i=="1":
    one+=1
print(min(zero,one)*2)

Buggy submission (verdict: Runtime Error):
s=input()
zero=0
one=0
for i in s:
  if i="0":
    zero+=1
  elif i="1":
    one+=1
print(min(zero,one)*2)
Problem p03137 (python)

Fixed submission:
n,m=map(int,input().split())
x=list(map(int,input().split()))
l=[]
ans=0
if n<m:
  x.sort()
  for i in range(m-1):
    l.append(x[i+1]-x[i])
  l.sort()
  for j in range(m-n):
    ans+=l[j]
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
n=[]
ans=0
if n>=m:
  print(0)
else:
  x.sort()
  for i in range(n-1):
    n.append(x[i+1]-x[i])
  n.sort(reverse=True)
  for j in range(n-1):
    ans+=n[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
l=[]
x.sort()
for i in range(1,len(x)):
  l.append(abs(x[i]-x[i-1]))
l.sort()
print(sum(l)-l[-1]-l[-2])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
l=[]
if n>m:
  print(0)
  exit()
for i in range(1,len(x)):  
  for j in range(i,len(x)):
    l.append(abs(x[0]-x[i-1])+abs(x[i]-x[j-1])+abs(x[j]-x[-1]))
print(min(n))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
n=[]
if n>m:
  print(0)
  exit()
for i in range(1,len(x)):  
  for j in range(i,len(x)):
    n.append(abs(x[0]-x[i-1])+abs(x[i]-x[j-1])+abs(x[j]-x[-1]))
print(min(n))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
n=[]
if n>,:
  print(0)
  exit()
for i in range(1,len(x)):  
  for j in range(i,len(x)):
    n.append(abs(x[0]-x[i-1])+abs(x[i]-x[j-1])+abs(x[j]-x[-1]))
print(min(n))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
n=[]
for i in range(1,len(x)):  
  for j in range(i,len(x)):
    n.append(abs(x[0]-x[i-1])+abs(x[i]-x[j-1])+abs(x[j]-x[-1]))
print(min(n))
Problem p03186 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b+1<c:
    print(b+a+b+1)
elif a+b+1==c:
    print(b+c)
elif a+b+1>c:
    if b+1>=c:
        print(b+c)
    elif b+1<c:
        print(b+c)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a+b+1<c:
    print(b+a+b+1)
elif a+b+1==c:
    print(b+c)
else a+b>c:
    if b+1>=c:
        print(c+1+c)
    elif b+1<c:
        print(b+c+1)
Problem p03208 (python)

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
l=[]
for i in range(len(h)-k+1):
  l.append(abs(h[i]-h[i+k-1]))
print(min(l))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=[i for i in range(n)]
h.sort()
l=[]
for i in range(k-2):
  l.append(abs(h[i]-h[i+k-1]))
print(min(l))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=[i for i in range(n)]
h.sort()
l=[]
for i in range(k-2):
  l.appwnd(abs(h[i]-h[i+k-1]))
print(min(l))
Problem p03221 (python)

Fixed submission:
n,m=map(int,input().split())
a=[[] for _ in range(n)]
ans=[None]*m

for i in range(m):
  p,y=map(int,input().split())
  a[p-1].append((y,i))
  
for i,b in enumerate(a):
  b.sort()
  for j,(y,k) in enumerate(b):
    ans[k]='%06d%06d' % (i+1,j+1)
    
print(*ans,sep='\n')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[[] for _ in range(n)]
ans=[None]*n

for i in range(m):
  p,y=map(int,input().split())
  a.append((y,i))
  
for i,b in enumerate(a):
  b.sort()
  for j,(y,k) in b:
    ans[k]='%06d%06d' % (i+1,j+1)
    
print(*ans,sep='\n')
Problem p03242 (python)

Fixed submission:
print(1110-int(input()))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
a=10-a
b=10-b
c=10-c
s=[a,b,c]
print("".join(s))
Problem p03327 (python)

Fixed submission:
n=int(input())
if n<1000:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=0
for i in range(1,a-b+1):
  n+=i
print(n-b)
Problem p03631 (python)

Fixed submission:
N=str(input())
if N==N[::-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
print(["No","Yes"][input()==input()[::-1]])

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==N[::-1]:
    print("Yes")
else:
    print("No")
Problem p03804 (python)

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

a=[]
b=[]

for i in range(N):
    a.append(input())

N=0

for i in range(M):
    b.append(input())
    if(b[i] in a[i]):
        N+=1

if(N==M):
    print("Yes")
else:
    print("No")
#コピペです。

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

a=[input() for i  in range(N)
b=[input() for i in range(M)]
N=0

if b[i] in a[i]:
    N+=1
    
if(N==M):
    print("Yes")
else:
    print("No")
#コピペです。
Problem p03834 (python)

Fixed submission:
s=input()
print(s.replace(",", " "))

Buggy submission (verdict: Runtime Error):
s=input()
pritn(s.replace(",", " "))

Buggy submission (verdict: Runtime Error):
pritn(input().replace(",", " "))

Buggy submission (verdict: Runtime Error):
pritn(input().replace(","," "))
Problem p03835 (python)

Fixed submission:
k,s=map(int,input().split())
print(sum(0<=s-x-y<=k for x in range(k+1) for y in range(k+1)))
#コピペです。

Buggy submission (verdict: Runtime Error):
k,s=map(int,input().split())
cnt=0
ans=0
for i in range(k+1):
  for j in range(k+1):
    for k in range(k+1):
      ans=i+j+k
      if ans=s:
        cnt+=1
print(cnt)
Problem p03986 (python)

Fixed submission:
x = list(input())
c = 0
for i in x:
  if i == "S":
    c += 1
  elif c>0:
    c -= 1
print(2*c)

Buggy submission (verdict: Runtime Error):
S = input()
s = t = 0
for c in S:
    if c == 'S':
        s += 1
    else:
       if s > 0:
           s -= 1
       else:
           t += 1
print(s+t)
＃コピペです
Problem p03272 (python)

Fixed submission:
a,b = map(int,input().split())
print(a- b + 1)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print(a - b + 1)
Problem p03803 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0] == a[1]:
  print("Draw")
elif (a[0] == 1 or a[0] >= a[1]) and a[1] !=1:
  print("Alice")
else:
  print("Bob")

Buggy submission (verdict: Runtime Error):
a = list(input().split())
a.replace("1","99")
if int(a[0]) > int(a[1]):
  print("Bob")
elif int(a[0]) == int(a[1]):
  print("Draw")
else:
  print("Alice")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
a.replace(1,99)
if a[0] > a[1]:
  print("Bob")
elif a[0] == a[1]:
  print("Draw")
else:
  print("Alice")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if a > b:
  print("Bob")
elif a == b:
  print("Draw")
else:
  print("Alice")
Problem p03073 (python)

Fixed submission:
S = list(map(int, input()))
ans1 = 0
ans2 = 0
for i in range (len(S)):
  if i % 2 == 0 and S[i] == 0:
      ans1 += 1
  elif i %2 ==1 and S[i] == 1:
      ans1 += 1
for i in range(len(S)):
  if i % 2 == 0 and S[i] == 1:
      ans2 += 1
  elif i % 2 ==1 and S[i] == 0:
      ans2 += 1
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
S = list(int, map(input().split()))
ans1 = 0
ans2 = 0
for i in range (len(S)):
  if i % 2 == 0:
    if S[i] == 0:
      ans1 += 1
  else:
    if S[i] == 1:
      ans1 += 1
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == 1:
      ans2 += 1
  else:
    if S[i] == 0:
      ans2 += 1
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
S = list(int, map(input().split()))
ans1 = 0
ans2 = 0
for i in range (len(S)-1):
  if i % 2 == 0:
    if S[i] == 0:
      ans1 += 1
  else:
    if S[i] == 1:
      ans1 += 1
for i in range(len(S)-1):
  if i % 2 == 0:
    if S[i] == 1:
      ans2 += 1
  else:
    if S[i] == 0:
      ans2 += 1
print(min(ans1, ans2))
Problem p03075 (python)

Fixed submission:
a, b, c, d, e = [int(input()) for i in range(5)]
k = int(input())
if max(e-a, e-b, d-a, e-c, d-b, c-a, e-d, d-c, c-b, b-a) > k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
a, b, c, d, e = [int(input) for i in range(5)]
k = int(input())
if e-a > k*4:
  print(":(")
elif e-b > k*3 or d-a > k*3:
  print(":(")
elif e-c > k*2 or d-b > k*2 or c-a > k*2:
  print(":(")
elif e-d > k or d-c > k or c-b > k or b-a > k:
  print(":(")
else:
  print("Yay!")
Problem p03077 (python)

Fixed submission:
n = int(input())
l = [int(input()) for i in range(5)]
if n % min(l) == 0:
  print(n//min(l)+4)
else:
  print(n//min(l)+5)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(5)]
m = min(l)
if m % l == 0:
  ans = l // m + 4
else:
  ans = l // m + 5
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(5)]
ans = 0
ans += n//l[0]+1
for i in range(1,5):
  if l(i-1) > l(i):
    ans += (n-n//l(i-1)*l(i))//l(i)+1
  else:
    ans += 1
print(ans)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n == 1:
    print(":(")
if n == 0:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n = 1:
    print(":(")
if n = 0:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
int n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n = 1:
    print(":(")
if n = 0:
    print("Yay!")
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i+1]:
         x = H[i+1]
         count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
count = 1
Max = H[0]
for i in range(1:N):
     if Max <=H[i]:
         Max = H[i]
         count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [int(input()) for i in range(N)]
count = 1
Max = H[0]
for i in range(1:N):
     if Max <=H[i]:
         Max = H[i]
         count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [int(input()) for i in range(N)
count = 1
Max = H[0]
for i in range(1:N):
     if Max < H[i]:
         Max = H[i]
         count += 1

print(count)
Problem p03135 (python)

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

Buggy submission (verdict: Runtime Error):
t,x = map(float,input(),split())
print(t / x)
Problem p03242 (python)

Fixed submission:
n=int(input())
print(1110-n)

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(3):
    if n[i] == 1:
        n[i] = 9
    else:
        n[i] = 1
        
print(n)
Problem p03250 (python)

Fixed submission:
a, b, c = map(int, (input().split()))
d = max(a,b,c)
print(d * 9 + a + b + c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
d = max(a,b,c)
print(9 * d + sum(a,b,c))
Problem p03072 (python)

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

n_pos = 0
max_c = 0
for i in c:
    if i>=max_c:
        n_pos += 1
        max_c = i
    else:
        pass
print(n_pos)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = list(map(int, input().split())) 
 
n_pos = 0
max_c = 0
for i in c:
  if (i>=max_c):
  	n_pos += 1
    max_c = i
  else:
    pass
print(n_pos)

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

n_pos = 0
max_c = 0
for i in c:
  if (i>=max_c):
  	n_pos += 1
    max_c = i
  else:
    pass
print(n_pos)

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

n_pos = 0
max_c = 0
for i in c:
  if i>=max_c:
  	n_pos += 1
    max_c = i
  else:
    pass
print(n_pos)

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

n_pos = 0
max_c = 0
for i in c:
  if i>=max:
  	n_pos += 1
    max_c = i
  else:
    pass
print(n_pos)

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

n_pos = 0
max = 0
for i in c:
  if i>=max:
  	n_pos += 1
    max = i
  else:
    pass
print(n_pos)
Problem p03073 (python)

Fixed submission:

m=input()
round = len(m)

n = 0

for i in range(round):
    if i % 2 == 0:
        if m[i] == '0':
            n = n+1
            
    else:
        if m[i] =='1':
            
            n = n+1

if n>round/2:
    print(round-n)
else:
    print(n)

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

o = 0

for i in range(p):
    if i % 2 == 0:
        if n[i] == '0':
            o= o+1
            
    else:
        if n[i] =='1':
            o= o+1

if ans>p/2:
    print(p-o)
else:
    print(o)
Problem p03326 (python)

Fixed submission:
N, M = map(int, input().split())
ppp, ppm, pmp, pmm, mpp, mpm, mmp, mmm = list(), list(), list(), list(), list(), list(), list(), list()
for _ in range(N):
    x, y, z = map(int, input().split())
    ppp.append(x + y + z)
    ppm.append(x + y - z)
    pmp.append(x - y + z)
    pmm.append(x - y - z)
    mpp.append(- x + y + z)
    mpm.append(- x + y - z)
    mmp.append(- x - y + z)
    mmm.append(- x - y - z)
tmp = [sum(sorted(ppp, reverse=True)[:M]), sum(sorted(ppm, reverse=True)[:M]), sum(sorted(pmp, reverse=True)[:M]), sum(sorted(pmm, reverse=True)[:M]),
       sum(sorted(mpp, reverse=True)[:M]), sum(sorted(mpm, reverse=True)[:M]), sum(sorted(mmp, reverse=True)[:M]), sum(sorted(mmm, reverse=True)[:M])]
out = max(tmp)
print(out)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
features = list()
for _ in range(N):
    f = map(int, input().split())
    features.append(list(f))

maximum = 0
index = list(itertools.combinations(range(0, N), M))
for i in index:
    s1, s2, s3 = 0, 0, 0
    for j in i:
        s1 += features[j][0]
        s2 += features[j][1]
        s3 += features[j][2]
    s = abs(s1) + abs(s2) + abs(s3)
    if s > maximum:
        maximum = s
print(maximum)
Problem p03250 (python)

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

A.sort()
M = 10 * int(A[-1]) + int(A[0]) + int(A[1])
print(M)

Buggy submission (verdict: Runtime Error):
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]
 
x = max(C)
y = min(D)
 
if x < y:
    A = 1
elif x >= y:
    A = 0

if A == 1:
    if X > x:
        if Y >= y:
            B = 1
    if Y < y:
        if X < x:
            B = 1
    if x < X and y > Y:
        B = 1
 
if A == 1 and B == 1:
    print('No War')
else:
    print('War')

Buggy submission (verdict: Runtime Error):
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]

x = max(C)
y = min(D)

if x < y:
    A = 1
elif x >= y:
    A = 0

if X > x:
    if Y >= y > X:
        B = 1
if Y < y:
    if X < x < Y:
        B = 1
if X < (x + y) / 2 <= Y:
    B = 1
if x < X and y > Y:
    B = 1

if A == 1 and B == 1:
    print('No War')
else:
    print('War')

Buggy submission (verdict: Runtime Error):
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]

x = max(C)
y = min(D)

if x < y:
    A = 1
elif x >= y:
    A = 0

if X > x:
  if Y >= y > X:
    B = 1
if Y < y:
  if X < x < Y:
    B = 1
if X < (x + y) / 2 <= Y:
    B = 1

if A == 1 and B == 1:
    print('No War')
else:
    print('War')
Problem p03327 (python)

Fixed submission:
N = int(input())
if N < 1000:
  print('ABC')
else:
  print('ABD')

Buggy submission (verdict: Runtime Error):
N = int(input())
if N < 1000:
  print(ABC)
else:
  print(ABD)
Problem p03135 (python)

Fixed submission:
from sys import stdin
T,X = map(int, stdin.readline().rstrip().split())
print(float(T/X))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
Ls = sorted(list(map(int,input().split())))
print("Yes" if max(Ls) < sum(Ls) - max(Ls) else "No")
Problem p03208 (python)

Fixed submission:
import sys
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    N = 5
    K = 3
    h = [10,15,11,14,12]
    # N = 5
    # K = 3
    # h = [5,7,5,7,7]

  h.sort()  

  ans = (h[K-1] - h[0])
  
  max_i = len(h)-K+1
  for i in range(1,max_i):
    tmp = (h[i+K-1] - h[i])
    if ans > tmp:
      ans = tmp
    if ans == 0:
      print(ans)
      sys.exit()
  
  print(ans)

main()

Buggy submission (verdict: Runtime Error):
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    # N = 5
    # K = 3
    # h = [10,15,11,14,12]
    N = 5
    K = 3
    h = [5,7,5,7,7]

  h.sort()
  for i in range(0,len(h)-K+1):
    if i == 0:
      ans = 0
      for n in range(0,K-1):
        ans += (h[n+1] - h[n])
    else:
      tmp = 0
      for n in range(i, i+K-1):
        tmp += (h[n+1] - h[n])
      if ans > tmp:
        ans = tmp
  
  print(ans)

main()

Buggy submission (verdict: Runtime Error):
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N,K = map(int, input().split())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    # N = 5
    # K = 3
    # h = [10,15,11,14,12]
    N = 5
    K = 3
    h = [5,7,5,7,7]

  h.sort()
  for i in range(0,len(h)-2):
    if i == 0:
      ans = 0
      for n in range(0,K-1):
        ans += (h[n+1] - h[n])
    else:
      tmp = 0
      for n in range(i, i+K-1):
        tmp += (h[n+1] - h[n])
      if ans > tmp:
        ans = tmp
  
  print(ans)

main()

Buggy submission (verdict: Runtime Error):
def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    K = int(input())
    h = []
    for _ in range(N):
      h.append(int(input()))
  else:
    # N = 5
    # K g= 3
    # h = [10,15,11,14,12]
    N = 5
    K = 3
    h = [5,7,5,7,7]

  h.sort()
  for i in range(0,len(h)-2):
    if i == 0:
      ans = (h[2] - h[1]) + (h[1] - h[0])
    else:
      tmp = (h[i+2] - h[i+1]) + (h[i+1] - h[i])
      if ans > tmp:
        ans = tmp
  
  print(ans)

main()