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

Fixed submission:
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

anslist = []

for i in range(X):
	for j in range(Y):
		for k in range(Z):
			if (i+1)*(j+1)*(k+1) <= K:
				anslist.append(A[i] + B[j] + C[k])
			else:
				break

anslist.sort()
anslist.reverse()
for hoge in range(K):
	print (anslist[hoge])

Buggy submission (verdict: Runtime Error):
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

m = max(X,Y,Z)


ansl = [0] * 3000
tmp = (5,5,5)
inda = 0
indb = 0
indc = 0

hoge = 10**12

sumab = []
for i in range(X):
	for j in range(Y):
		sumab.append(A[i] + B[j])

sumab.sort()
sumab.reverse()

anslist = []
for k in range(K):
	for cc in range(Z):
		anslist.append(sumab[k] + C[cc])
		
anslist.sort()
anslist.reverse()
for aa in range(K):
	print (anslist[aa])
Problem p03129 (python)

Fixed submission:
n,k = map(int,input().split())
cnt=0
for i in range(1,n+1,2):
  cnt += 1

if k <= cnt:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if k <= cnt:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if (k<=cnt):
  print("YES")
else:
  print("NO")
Problem p03210 (python)

Fixed submission:
a = int(input())
 
if (a == 7) or (a == 5) or (a == 3):
  print("YES")
else:
  print("NO")

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

if (a == 7) or (a == 5) or (a == 3):
  print("YES")
else print("NO")
Problem p03214 (python)

Fixed submission:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
m = np.mean(a)
ans = 0
mx = 999999
for i in range(n):
	if abs(a[i] - m) < mx:
		mx = abs(a[i] - m)
		ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
m = np.mean(a)
ans = 0
mx = 999999
for i in range(n):
  if abs(a[i] - m) < dist:
    dist = abs(a[i] - m)
    ans = i
print(ans)
Problem p03377 (python)

Fixed submission:
a,b,x = map(int,input().split())
 
if (a <= x) and (a + b >= x):
  print("YES")
else:
  print("NO")

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

if (a <= x) and (a + b >= x):
  print("YES")
else:
  print("NO")
Problem p03469 (python)

Fixed submission:
s = input()

ans = ""
for i in range(len(s)):
  if (i == 3):
    ans += "8"
  else:
    ans += s[i]
 

print (ans)

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

ans = ""
for i in range(len(s)):
  if (i == 3) ans += "8"
  else ans += s[i]
 

print (ans)
Problem p03597 (python)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)

Buggy submission (verdict: Runtime Error):
n,a = map(int,input().split())
print(n*n-a)
Problem p02536 (python)

Fixed submission:
N, M = map(int, input().split())
parents = [i for i in range(N+1)]

def find(x):
    if x == parents[x]:
        return x
    else:
        parents[x] = find(parents[x])
        return parents[x]
    
def same(A, B):
    x, y = find(A), find(B)
    if x==y:
        return
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    same(A, B)
    
for i in range(N):
    find(i+1)

print(len(set(parents)) - 2)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
parents = [i for i in range(N+1)]

def find(x):
    if x == parents[x]:
        return x
    else:
        x = find(parents[x])
        return x
    
def same(x, y):
    if x==y:
        pass
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    x, y = find(A), find(B)
    same(x, y)

print(len(set(parents)) - 2)

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

def find(x):
    if x == parents[x]:
        return x
    else:
        x = find(parents[x])
        return x
    
def same(x, y):
    if x==y:
        pass
    else:
        parents[x] = y

for _ in range(M):
    A, B = map(int, input().split())
    x, y = find(A), find(B)
    same(x, y)

print(len(set(uni.parents)) - 2)
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())

a = -1
b = -1
c = -1
judge = False

for x in range(N, -1, -1):
    money_max = x * 10000 + (N-x) * 5000
    money_min = x * 10000 + (N-x) * 1000
    if money_min <= Y and Y <= money_max:
        for y in range(N-x, -1, -1):
            money = x * 10000 + y * 5000 + (N - x - y)* 1000
            if money == Y:
                a = x
                b = y
                c = N - (x + y)
                judge = True
                break
    if judge:
        break
print(a, b, c)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
a = -1
b = -1
c = -1
judge = False

money = x * 10000 + y * 5000 + z * 1000
for x in range(20, -1, -1):
    money_max = x * 10000 + (N-x) * 5000
    money_min = x * 10000 + (N-x) * 1000
    if money_min <= Y and Y <=money_max:
        for y in range(N-x, -1, -1):
            money = x * 10000 + y * 5000 + (N - x - y)* 1000
            if money == Y:
                a = x
                b = y
                c = N - (x + y)
                judge = True
                break
    if judge:
        break
print(a, b, c)
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, input().split())

li = sorted([a, b, c])
ans = 'No'
if sum(li[:2])==li[2]:
    ans ='Yes'
print(ans)

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

xy = [0, W, 0, H]
judge = True
for n in range(N):
    x, y, a = map(int, input().split())
    a -= 1
    if a<=1 and judge:
        xy[a] = x
        if xy[0] >= xy[1]:
            judge = False
    else:
        xy[a] = y
        if xy[2] >= xy[3]:
            judge = False
    print(xy)
area = (xy[1] - xy[0]) * (xy[3] - xy[2])
if not judge:
    area = 0
    print(area)
Problem p04043 (python)

Fixed submission:
A, B, C = map(int, input().split())
 
num5 = 0
num7 = 0
ans = 'NO'
 
for num in [A, B, C]:
  if num == 5:
    num5+=1
  elif num == 7:
    num7+=1
  else:
    break
if num5 ==2 and num7 == 1:
  ans = 'YES'
print(ans)

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

num5 = 0
num7 = 0
ans = 'NO'

for num in [A, B, C]:
  if num == 5:
    num5+=1
  elif num == 7:
    num7+=1
  else:
    break
if num5 ==2 and num7 == 1:
  ans = 'YES'
print(ans)
Problem p02534 (python)

Fixed submission:
print("ACL" * int(input()))

Buggy submission (verdict: Runtime Error):
return "ACL" * int(input())
Problem p02603 (python)

Fixed submission:
days = int(input())
vals = [int(x) for x in input().split()]
has = 1000
for i in range(days - 1):
    if vals[i] <= vals[i+1]:
        can, has = divmod(has, vals[i])
        has += can * (vals[i+1])
print(has)

Buggy submission (verdict: Runtime Error):
days = int(input())
vals = [int(x) for x in input().split()]
has = 1000
for i in range(days - 1)
    if vals[i] <= vals[i+1]:
        can, has = divmod(has, vals[i])
        has += can * (vals[i+1])
return has
Problem p02657 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
print(a * b)

Buggy submission (verdict: Runtime Error):
print(int(input() * int(input()))
Problem p02675 (python)

Fixed submission:
counter = int(input())
res = counter % 10
if res in [2,4,5,7,9]:
    print("hon")
elif res in [0, 1, 6, 8]:
    print("pon")
else:print("bon")

Buggy submission (verdict: Runtime Error):

counter = int(input())
res = counter % 10
if res in [2,4,5,7,9]:print("hon")
elif res in [0, 1 6, 8]:print("pon")
else:print("bon")
Problem p02696 (python)

Fixed submission:
from math import floor
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)

Buggy submission (verdict: Runtime Error):
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer)
Problem p02705 (python)

Fixed submission:
from math import pi
radius = int(input())
answer = 2 * pi * radius
print(answer)

Buggy submission (verdict: Runtime Error):
radius = int(input())
answer = 2 * math.pi * radius
print(answer)
Problem p02724 (python)

Fixed submission:
has = int(input())
canbe = 0
_500, has = divmod(has, 500)
canbe += _500 * 1000
_5, has  = divmod(has, 5)
canbe += _5 * 5
print(canbe)

Buggy submission (verdict: Runtime Error):
fun main()
{
    var has = readLine()!!.toInt()
    var happiness = 0
    if (has > 500)
    {
        var _500 = has / 500
        happiness = _500 * 1000
        has = has - _500 * 500
    }
    if (has > 5)
    {
        var _5 = has / 5
        happiness += _5 * 5
    }
    print(happiness)
}
Problem p02778 (python)

Fixed submission:
ins = input()
lens = len(ins)
print("x" * lens)

Buggy submission (verdict: Runtime Error):
print("X" * len(input())
Problem p02783 (python)

Fixed submission:
H, A = [int(x) for x in input().split()]
print( (H // A ) + (H % A > 0))

Buggy submission (verdict: Runtime Error):
'''
211 5
31 41 59 26 53
'''
power, moves = [int(x) for x in input().split()]
powers = sum([int(x) for x in input().split()])
print(["No","Yes"][powers >= power])
Problem p02801 (python)

Fixed submission:
from string import ascii_lowercase as lc
given = input()
print(lc[lc.index(given) + 1])

Buggy submission (verdict: Runtime Error):
from strings import ascii_lowercase as lc
given = input()
print(lc[lc.index(given) + 1])
Problem p02817 (python)

Fixed submission:
print("".join(input().split()[::-1]))

Buggy submission (verdict: Runtime Error):
return "".join(input().split()[::-1])
Problem p02818 (python)

Fixed submission:
# B - Greedy Takahashi

A, B, K = [int(x) for x in input().split()]
AB = A + B
if A > K:
    print(A - K, B)
elif AB > K:
    print(0, AB - K)
else:
    print(0, 0)

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split()]
print(*[max(0, A - k),max(0, B - k)])

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split()]
return max(0, A - k) + max(0, B - k)
Problem p02853 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
won = 0
if a in range(1, 4):
  won  += [0,300000,200000,100000][a]
if b in range(1, 4):
  won  += [0,300000,200000,100000][b]
if a == 1 and b == 1:won += 400000  
 
print(won)

Buggy submission (verdict: Runtime Error):
a, b = [int(x)-1 for x in input().split()]
won = 0
if a in range(3):
  won  += [300000,200000,200000][a]
if b in range(3):
  won  += [300000,200000,200000][a]
won += 400000 * (a == 0 and b == 0)
print(won)
Problem p02921 (python)

Fixed submission:
print( sum([1 for x, y in zip(input(), input()) if x == y]) )

Buggy submission (verdict: Runtime Error):
'''
CSS
CSR
'''
prin( sum([1 for x, y in zip(input(), input()) if x == y]
Problem p02934 (python)

Fixed submission:
lens = int(input())
arrs = sum([1/int(x) for x in input().split()])
if arrs != 0:
  print(1/arrs)

Buggy submission (verdict: Runtime Error):
'''
2
10 30
'''
lens = int(input())
arrs = [1/int(x) for x in input().split()]
print(1/arrs)
Problem p02945 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b ))

Buggy submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b)
Problem p02947 (python)

Fixed submission:
n = int(input())
ws = [list(input()) for _ in range(n)]
 
def sort_l(l):
    l.sort()
    return l
ws = list(map(sort_l, ws))
ws.sort()
 
i = 0
j = 0
r = 0
ans = 0
while(i<n-1):
    i += 1
    if ws[i] == ws[j]:
        r += 1
    else:
        ans += r * (r+1) // 2
        r = 0
        j = i
ans += r * (r+1) // 2
 
print(ans)

Buggy submission (verdict: Runtime Error):
lens = int(input())
hashes = sorted()[''.join(sorted(input())) for _ in range(lens)])
i = 0
j = 0
r = 0
ans = 0
while i < lens - 1:
    i += 1
    if hashes[i] == hashes[j]:
        r += 1
    else:
        ans += (r * (r + 1)) // 2
        r = 0
        j = i
ans += (r ( r + 1))//2
print(ans)

Buggy submission (verdict: Runtime Error):

lens = int(input())
hashes = [''.join(sorted(input())) for _ in range(lens)]
i = 0
j = 0
r = 0
ans = 0
while i < lens - 1:
    i += 1
    if hashes[i] == hashes[j]:
        r += 1
    else:
        ans += (r * (r + 1)) // 2
        r = 0
        j = i
ans += (r ( r + 1))//2
print(ans)
Problem p02981 (python)

Fixed submission:
n, a, b = [int(x) for x in input().split()]
print(min(a * n,b))

Buggy submission (verdict: Runtime Error):
n, a, b = [int(x) for x in input().split()]
print(min(a * n,b)
Problem p03005 (python)

Fixed submission:
n, k = [int(x) for x in input().split()]
if k == 1:print(0)
else:
  print( ((n - k) + 1) - 1)

Buggy submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
# @Date    : 2019-06-15 20:02:29
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

import sys
sys.setrecursionlimit(10**5+1)

inf     =  int(10 ** 20)
max_val =  inf
min_val = -inf

RW  = lambda : sys.stdin.readline().strip()
RI  = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from collections import defaultdict

nb_points = RI()
points    = [RMI() for _ in range(nb_points)]
pq = defaultdict(int)
for i in range(nb_points):
    for j in range(nb_points):
        if i == j : continue
        p1 = points[i][0] - points[j][0]
        q1 = points[i][1] - points[j][1]
        pq[(p1, q1)]  = pq.get((p1, q1), 0) + 1
print(nb_points - max(pq.values()))
Problem p03006 (python)

Fixed submission:

# -*- coding: utf-8 -*-
# @Date    : 2019-06-15 20:02:29
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

import sys
sys.setrecursionlimit(10**5+1)

inf     =  int(10 ** 20)
max_val =  inf
min_val = -inf

RW  = lambda : sys.stdin.readline().strip()
RI  = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from collections import defaultdict

nb_points = RI()
points    = [RMI() for _ in range(nb_points)]
if nb_points == 1:
    print(1)
else:
    pq = defaultdict(int)
    for i in range(nb_points):
        for j in range(nb_points):
            if i == j : continue
            p1 = points[i][0] - points[j][0]
            q1 = points[i][1] - points[j][1]
            pq[(p1, q1)]  = pq.get((p1, q1), 0) + 1
    print(nb_points - max(pq.values()))

Buggy submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
# @Date    : 2019-06-15 20:02:29
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

import sys
sys.setrecursionlimit(10**5+1)

inf     =  int(10 ** 20)
max_val =  inf
min_val = -inf

RW  = lambda : sys.stdin.readline().strip()
RI  = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from collections import defaultdict

nb_points = RI()
points    = [RMI() for _ in range(nb_points)]
pq = defaultdict(int)
for i in range(nb_points):
    for j in range(nb_points):
        if i == j : continue
        p1 = points[i][0] - points[j][0]
        q1 = points[i][1] - points[j][1]
        pq[(p1, q1)]  = pq.get((p1, q1), 0) + 1
print(nb_points - max(pq.values()))

Buggy submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
# @Date    : 2019-06-15 20:02:29
# @Author  : raj lath (oorja.halt@gmail.com)
# @Link    : link
# @Version : 1.0.0

import sys
sys.setrecursionlimit(10**5+1)

inf     =  int(10 ** 20)
max_val =  inf
min_val = -inf

RW  = lambda : sys.stdin.readline().strip()
RI  = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from collections import defaultdict

nb_points = RI()
points    = [RMI() for _ in range(nb_points)]
pq = defaultdict(int)
for i in range(nb_points):
    for j in range(nb_points):
        if i == j : continue
        p1 = points[i][0] - points[j][0]
        q1 = points[i][1] - points[j][1]
        pq[(p1, q1)] += 1
print(nb_points - max(pq.values()))
Problem p02882 (python)

Fixed submission:
import math
a,b,x = map(float, input().split())

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b - x + b)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-10:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


#def toFixed(numObj, digits=0):
#    return f"{numObj:.{digits}f}"


print(bin_search(a,b,x/a))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(float, input().split())

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b - x + b)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-10:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


def toFixed(numObj, digits=0):
    return f"{numObj:.{digits}f}"


print(toFixed(bin_search(a,b,x/a),10))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(float, input().split())

def toFixed(numObj, digits=0):
    return f"{numObj:.{digits}f}"

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b + x)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-6:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


print(toFixed(bin_search(a,b,x/a),10))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(float, input().split())

def toFixed(numObj, digits=0):
    return f"{numObj:.{digits}f}"

def ok(mid,a,b,x_s):
    x = a * math.sin(mid*math.pi/180)/math.sin(math.pi/2 - (mid * math.pi/180))
    s = 0
    if b - x > 0:
        s = (b + x)/2 * a
    else:
        x = b * math.sin(math.pi/2 - (mid * math.pi/180))/math.sin(mid*math.pi/180)
        s = 0.5 * x * b
    if s < x_s:
        return -1
    else:
        return 1

def bin_search(a,b,x):
    l = 0.0
    r = 90.0
    while abs(l - r) > 1e-6:
        mid = l + (r - l)/2
        res = ok(mid,a,b,x)
        if res < 0:
            r = mid
        else:
            l = mid
    return r


print(toFixed(bin_search(a,b,x/a),10))
Problem p02885 (python)

Fixed submission:
a,b = map(int,input().split())
print(max(a - 2*b, 0))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max(a - 2*b), 0)
Problem p03164 (python)

Fixed submission:
n,w = map(int, input().split())
a = [[int(x) for x in input().split()] for i in range(n)]
dp = [10**100 for i in range(10**5 + 1)]
dp[0] = 0
for i in range(n):
    for j in range(10**5, -1, -1):
        if dp[j] != 10**100:
            dp[j + a[i][1]] = min(dp[j + a[i][1]], dp[j] + a[i][0])
for i in range(10**5, -1, -1):
    if dp[i] <= w:
        print(i)
        exit(0)

Buggy submission (verdict: Runtime Error):
n,w = map(int, input().split())
a = [[int(x) for x in input().split()] for i in range(n)]
dp = [10**100 for i in range(10**4 + 1)]
dp[0] = 0
for i in range(n):
    for j in range(10**4, -1, -1):
        if dp[j] != 10**100:
            dp[j + a[i][1]] = min(dp[j + a[i][1]], dp[j] + a[i][0])
for i in range(10**4, -1, -1):
    if dp[i] <= w:
        print(i)
        exit(0)
Problem p02583 (python)

Fixed submission:
n = int(input())

l = list(map(int,input().split()))

l.sort()
ans = 0

if n < 2:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k] and l[i] < l[j] < l[k]:
          ans += 1
  print(ans)

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

l = list(map(int,input().split()))

l.sort()

if n < 3:
  print(0)

else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k] and l[i] is not l[j] and l[j] is not l[k] and l[k] is not l[i]:
          ans += 1
  print(ans)

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

l = list(map(int,input().split()))

s = l.sort()

ans = 0
if n <3:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if s[i] + s[j] > s[k] and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
          ans += 1
  print(ans)

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

l = list(map(int,input().split()))

l.sort()

ans = 0
if n <3:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k]　and l[j] + l[k] > l[i]　and l[k] + l[i] > l[j]:
          ans += 1
  print(ans)
Problem p03281 (python)

Fixed submission:
N=int(input())

result=0
for i in range(1,N+1):
    if i%2!=0:
        divisor=0
        for j in range(1,i+1):
            if i%j==0:
                divisor+=1
        if divisor==8:
            result+=1
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
cnt = 0

for i in range(1,n+1):
  for j in range(1,n+1):
    if i%j = 0:
      ans += 1
  if ans = 8:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
cnt = 0

for i in range(1,n+1):
  for j in range(1,n+1):
    if i%j = 0:
      ans += 1
  if ans = 8:
      
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
cnt = 0

for i in range(1,n+1):
  for j in range(1,n+1):
    if i%j = 0:
      ans += 1
    if ans = 8:
      cnt += 1

print(cnt)
Problem p03361 (python)

Fixed submission:
H,W = map(int,input().split())
S = ["."*(W+2)]+["."+input()+"." for h in range(H)]+["."*(W+2)]

for h in range(1,H+1):
  for w in range(1,W+1):
    if S[h][w]=="#" and S[h-1][w]=="." and S[h+1][w]=="." and S[h][w-1]=="." and S[h][w+1]==".":
      print("No")
      exit()
      
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
s = [input() for _ in range(w)]
l = []
for i in range(1,h-1):
    for j in range(1,w-1):
        if s[i][j] == "#":
            if s[i+1][j] == "#" or s[i-1][j] == "#" or s[i][j+1] == "#" or s[i][j-1] == "#":
                l.append(0)
            else:
                l.append(1)

if sum(l) == 0:
    print("Yes")
else:
    print("No")
Problem p03449 (python)

Fixed submission:
n  = int(input())

a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(sum(a[0:i+1]) + sum(b[i:n]))


print(max(ans))

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

a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(sum(a[0:i+1] + sum(b[i:n]))

print(max(ans))