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

Fixed submission:
N = int(input())

a = [int(i) for i in input().split()]

ans = []
sum = 0

for j in range(min(a), max(a)):
    for num in a:
        sum += (num - j) ** 2
    else:
        ans.append(sum)
        sum = 0

if len(ans) == 0:
    print(0)
else:
    print(min(ans))

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

li_ans = []
ans = 0

for j in range(min(a), max(a)):
    for k in a:
        ans += abs(k - j) ** 2
    else:
        li_ans.appned(ans)
        ans = 0

if len(li_ans) == 0:
    print(0)
else:
    print(min(li_ans))

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

li_ans = []
ans = 0

for num in (min(a), max(a)):
    for j in range(len(a)):
        ans += abs(a[j] - num) ** 2
    else:
        li_ans.appned(ans)
        ans = 0

if len(li_ans) == 0:
    print(0)
else:
    print(min(li_ans))

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

li_ans = []
ans = 0

for num in (min(a), max(a)):
    for j in range(len(a)):
        ans += abs(a[j] - num) ** 2
    else:
        li_ans.appned(ans)
        ans = 0

print(min(li_ans))

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

a = [int(i) for i in input().split()]

ans = []
sum = 0

for j in range(min(a), max(a)):
    for num in a:
        sum += (num - j) ** 2
    else:
        ans.append(sum)
        sum = 0

if ans == None:
    ans.appned(0)

print(min(ans))

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

a = [int(i) for i in input().split()]

ans = []
sum = 0

for j in range(min(a), max(a)):
    for num in a:
        sum += (num - j) ** 2
    else:
        ans.append(sum)
        sum = 0

print(min(ans))
Problem p04045 (python)

Fixed submission:
def abc042_c():
    price, len_hate_set = map(int, input().split())
    hate_set = set([int(i) for i in input().split()])

    usable_list = list(set(range(0, 10)) - hate_set)

    ans = 0

    while True:
        if all(map(lambda x: int(x) in usable_list, [int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
            return ans

        ans += 1


if __name__ == '__main__':
    print(abc042_c())

Buggy submission (verdict: Runtime Error):
price, len_hate_set = map(int, input().split())
hate_set = set([int(i) for i in input().split()])

ans = 0

while True:
    if all(map(lambda x: int(x) in set(range(0, 10)) - hate_set, [int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
        return ans
    ans += 1

Buggy submission (verdict: Runtime Error):
price, len_hate_set = map(int, input().split())
hate_set = set([int(i) for i in input().split()])

ans = 0

while True:
    if all(map(lambda x: int(x) in set(range(0, 10)) - hate_set, 
               [int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
        print ans

    ans += 1
Problem p02997 (python)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n, k = (int(i) for i in input().split())

if n == 2:
    if k == 0:
        print(1)
        print(1, 2)
    else:
        print(-1)
else:
    total = cmb(n - 1, 2)
    
    if total < k:
        print(-1)
    else:
        dif = total - k

        print(n - 1 + dif)
        for i in range(n - 1):
            print(1, i + 2)

        p = 2
        c = 3
        while True:
            if dif == 0:
                break

            if c > n:
                p += 1
                c = p + 1
                print(p, c)
                c += 1
            else:
                print(p, c)
                c += 1

            dif -= 1

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n, k = (int(i) for i in input().split())
total = cmb(n - 1, 2)

if n == 2:
    print(-1)
elif total < k:
    print(-1)
else:
    dif = total - k

    print(n - 1 + dif)
    for i in range(n - 1):
        print(1, i + 2)

    p = 2
    c = 3
    while True:
        if dif == 0:
            break

        if c > n:
            p += 1
            c = p + 1
            print(p, c)
            c += 1
        else:
            print(p, c)
            c += 1

        dif -= 1

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n, k = (int(i) for i in input().split())
total = cmb(n - 1, 2)

if total < k:
    print(-1)
else:
    dif = total - k

    print(n - 1 + dif)
    for i in range(n - 1):
        print(1, i + 2)

    p = 2
    c = 3
    while True:
        if dif == 0:
            break

        if c > n:
            p += 1
            c = p + 1
            print(p, c)
            c += 1
        else:
            print(p, c)
            c += 1

        dif -= 1

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
  
n, k = (int(i) for i in input().split())
total = cmb(n - 1, 2)
flag = True

if total < k:
    print(-1)
    flag = False

dif = total - k

print(n - 1 + dif)
for i in range(n - 1):
    print(1, i + 2)
    
p = 2
c = 3
while True:
    if dif == 0:
        break
        
    if c > n:
        p += 1
        c = p + 1
        print(p, c)
        c += 1
    else:
        print(p, c)
        c += 1
        
    dif -= 1
Problem p03043 (python)

Fixed submission:
import numpy as np
 
n, k = map(int, input().split())
ans = 0
 
for i in range(1, n + 1):
  if i>= k:
    ans += 1 / n
  else:
    ans += np.power(1 / 2, np.ceil(np.log2(k / i))) / n
    
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input())
ans = 0

for i in range(1, n):
  if i >= k:
    ans += 1.0 / n
    
  ans += np.power(1 / 2, np.ceil(np.log2(k / i))) / n
  
print(ans)
Problem p03061 (python)

Fixed submission:
import fractions

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(fractions.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(fractions.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(fractions.gcd(left[i], right[i + 1]))
    
print(max(m))

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(numpy.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(numpy.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(numpy.gcd(left[i], right[i + 1]))
    
print(max(m))

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(numpy.gcd(left[-1], a))

a_list.reverse()
for a in a_list:
    right.append(numpy.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(numpy.gcd(left[i], right[i + 1]))

print(max(m))

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(numpy.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(numpy.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(numpy.gcd(left[i], right[i + 1]))
    
print(max(m))

Buggy submission (verdict: Runtime Error):
import np

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(np.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(np.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(np.gcd(left[i], right[i + 1]))
    
print(max(m))

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a_list = [int(a) for a in input().split()]

left = [0]
right = [0]
for a in a_list:
    left.append(math.gcd(left[-1], a))
    
a_list.reverse()
for a in a_list:
    right.append(math.gcd(right[-1], a))

right.reverse()

m = []
for i in range(len(a_list)):
    m.append(math.gcd(left[i], right[i + 1]))
    
print(max(m))
Problem p03146 (python)

Fixed submission:
s = int(input())
a = [s]

counter = 2
while True:
    if a[-1] % 2 == 0:
        temp = int(a[-1] / 2)
    else:
        temp = int(3 * a[-1] + 1)
    
    if temp in a:
        break
        
    counter += 1
    a.append(temp)
    
print(counter)

Buggy submission (verdict: Runtime Error):
a, b, _ = map(int, input().split())
print(a * b / 2)
Problem p03693 (python)

Fixed submission:
numbers = [i for i in input().split()]
number = numbers[0] + numbers[1] + numbers[2]
number = int(number)

if number % 4:
    print("NO")
else:
    print("YES")

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


# In[7]:

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " " + str(answer))
else:
    if answer == 1:
        print("1 " + str(counter["color"]))
    else:
        print(str(answer-1) + " " + str(answer-1+counter["color"]))

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


# In[7]:

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    if answer == 1:
        print("1 " + str(counter["colors"]))
    else:
        print(str(answer) + " " + str(answer))
else:
    print(str(answer-1) + " " + str(answer-1+counter["color"]))
Problem p02971 (python)

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

b = sorted(a)
maxnum = b[-1]
nextmaxnum = b[-2]

if maxnum == nextmaxnum:
  for i in range(n):
    print(maxnum)
else:
  for i in range(n):
    if a[i] == maxnum:
      print(nextmaxnum)
    else:
      print(maxnum)

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

b = sorted(a)
maxnum = b[-1]
nextmaxnum = b[-2]

if maxnum == nextmaxnum:
  for i in range(n):
    print(maxnum)
else:
  for i in range(n):
    if a.pop(i) == maxnum:
      print(nextmaxnum)
    else:
      print(maxnum)
Problem p02996 (python)

Fixed submission:
n = int(input())
a = [0] * n
b = [0] * n
task = []

for i in range(n):
  a[i],b[i] = map(int, input().split())
  temp = [a[i],b[i]]
  task.append(temp)
  
task.sort(key=lambda x: x[1])
suma = 0
output = 'Yes'

for i in range(n):
  suma += task[i][0]
  if suma > task[i][1]:
    output = 'No'
    break

print(output)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [0] * n
b = [0] * n
task = []

for i in range(n):
  a[i],b[i] = map(int, input().split())
  temp = [a[i],b[i]]
  task.append(temp)
  
task.sort(key=lambda x: x[1])
suma = 0
output = 'Yes'

for i in range(n):
  suma += task[i][0]
  if suma > task[i][i]:
    output = 'No'
    break

print(output)
Problem p03423 (python)

Fixed submission:
n = int(input())
print(int(n/3))

Buggy submission (verdict: Runtime Error):
n = int(input())
fukuro = list(map(str,input().split()))
types = 'Three'
for i in range(len(fukuro)):
  if fukuro[i] == 'Y':
    types = 'Four'
    break
print(types)
Problem p03455 (python)

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

if a*b%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
c = a * b
if c % 2 == 0:
  print(Even)
else:
  print(Odd)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a * b % 2 == 0:
  print(Even)
else:
  print(Odd)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a*b%2 == 0:
  print(even)
else:
  print(odd)
Problem p03493 (python)

Fixed submission:
a = input()

snum = 0
if a[0] == '1':
  snum += 1
if a[1] == '1':
  snum += 1
if a[2] == '1':
  snum +=1

print(snum)

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

exec_count = 0

while True:
  exist_odd = False
  
  for i in range(N):
    if A[i]%2 == 1:
      exist_odd = True
  if exist_odd == True:
    break
  else:
    exec_count += 1
    for i in range(N):
      A[i] = A[i]/2
      
print(exec_count)
Problem p03777 (python)

Fixed submission:
a, b=map(str, input().split())
if a is 'H':
    if b is 'H':
        print('H')
    else:
        print('D')
else:
    if b is 'H':
        print('D')
    else:
        print('H')

Buggy submission (verdict: Runtime Error):
a, b=map(str, input().split())
if a is "H"
    if b is "H"
        print("H")
    else:
        print("D")
else:
    if b is "H"
        print("D")
    else:
        print("H")
Problem p03852 (python)

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

Buggy submission (verdict: Runtime Error):
a = set("a", "e", "i", "o", "u")
if input() in a:
    print("vowel")
else:
    print("consonant")
Problem p03962 (python)

Fixed submission:
from collections import Counter
a = Counter(list(map(str, input().split())))
print(len(a))

Buggy submission (verdict: Runtime Error):
a = set(map(int, input()))
print(len(a))
Problem p02947 (python)

Fixed submission:
from collections import Counter
from scipy.misc import comb
N = int(input())
string_list=["".join(sorted(input())) for i in range(N)]

ans = 0
c = Counter(string_list)

for v in c.values():
    ans += comb(v, 2, exact=True)

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from scipy.special import comb
N = int(input())
string_list=["".join(sorted(input())) for i in range(N)]

ans = 0
c = Counter(string_list)

for v in c.values():
    ans += comb(v, 2, exact=True)

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb
N = int(input())
string_list=["".join(sorted(input())) for i in range(N)]

ans = 0
c = collections.Counter(string_list)

for v in c.values():
    ans += comb(v, 2, exact=True)

print(ans)
Problem p03284 (python)

Fixed submission:
#105

N, K = map(int, input().rstrip().split())
if N%K == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
#105

N, K = map(int, input().rstrip().split())
    if N%K == 0:
        print(0)
    else:
        print(1)

Buggy submission (verdict: Runtime Error):
#105

N, K = map(int, input().rstrip().split()):
    if N%K == 0:
        print(0)
    else:
        print(1)
Problem p03323 (python)

Fixed submission:
#100

A, B = map(int, input().rstrip().split())
if A > 8 or B > 8:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
#100

A, B = map(int, input().rsrtip().split())
if A > 8 or B > 8:
    print("Yay")
else:
    print(":(")
Problem p03337 (python)

Fixed submission:
#98

A, B = map(int, input().rstrip().split())
print(max(A+B, A-B, A*B))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().rstrip().sprit())
print(max(A+B, A-B, A*B))
Problem p03399 (python)

Fixed submission:
#92

li = [int(input().rstrip()) for x in range(4)]

print(min(li[0]+li[2], li[0]+li[3], li[1]+li[2], li[1]+li[3]))

Buggy submission (verdict: Runtime Error):
#92

li = [int(input().rstrip()) for x in range(4)]

print(min(A+C, A+D, B+C, B+D))
Problem p03447 (python)

Fixed submission:
#87

X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

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

comb = 0

for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      total = int(500 * i + 100 * j + 50 * k)
      if total == x:
        comb += 1
print(comb)
Problem p03455 (python)

Fixed submission:
li = list(map(int, input().rstrip().split()))

if (li[0] * li[1]) % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
li = map(int,input().rstrip().split())
m = li[0] * li[1]

if m % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
from sys import stdin
l = int(stdin.readline().rstrip().split())

m = l[0] * l[1]
if m % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = int(stdin.readline().rstrip())
Problem p03469 (python)

Fixed submission:
#85

S = list(input())
S[3] = "8"

print("".join(S))

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().rstrip().split())
a, b, c = -1, -1, -1

for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i + 5000*j + 1000*(n-i-j) ==  y:
            a, b, c = i, j, n-i-j
            break
    else:
        continue
    break
print(a, b, c)
Problem p03494 (python)

Fixed submission:
N = int(input())
li = list(map(int, input().rstrip().split()))

counter = 0
i = 0

while li[i] % 2 == 0:
    counter += 1
    li[i] = li[i] / 2
    if i == N-1:
      i = 0
    else:
      i += 1
print(int(counter/N))

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

i = 0
counter = 0

while li[i] % 2 == 0:
  counter += 1
  i += 1
else:
  print(counter / N)
Problem p03501 (python)

Fixed submission:
#80

N, A, B = map(int, input().rstrip().split())
print(min(N*A, B))

Buggy submission (verdict: Runtime Error):
#80

N, A, B = map(int, input().rstrip().split())
print(min(N*A, B)
Problem p03671 (python)

Fixed submission:
#66

a, b, c = map(int, input().rstrip().split())

print(min(a+b, b+c, c+a))

Buggy submission (verdict: Runtime Error):
#66

a, b, c = map(int, input().rstrip(),split())

print(min(a+b, b+c, c+a))
Problem p02934 (python)

Fixed submission:
import math
import fractions

def gcd_list(numbers):
    for i in range(1, len(numbers)):
        ans = fractions.gcd(ans, numbers[i])
    return ans

def lcm_list(numbers):
    ans = numbers[0]
    for i in range(1, len(numbers)):
        ans = ans * numbers[i] // fractions.gcd(ans, numbers[i])
    return ans



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

lcm = lcm_list(A_line)
mother = sum(map(lambda x: lcm//x, A_line))

print(lcm/mother)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)



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

lcm = lcm_list(A_line)
mother = sum(map(lambda x: lcm//x, A_line))

print(lcm/mother)
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h_s = list(map(int, input().split()))+[0]*K
# print(h_s)
dp = [float("inf")]*(N+K)
dp[0] = 0
 
for i in range(N):
    for j in range(1, K+1):
        dp[i+j] = min(dp[i+j], dp[i]+abs(h_s[i]-h_s[i+j]))
 
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h_s = list(map(int, input().split()))
# print(h_s)
dp = [float("inf")]*(N+K)
dp[0] = 0

for i in range(N):
    for j in range(K):
        dp[i+j] = min(dp[i+j], dp[i]+abs(h_s[i]-h_s[i+j]))

print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
h_s = list(map(int, input().split()))+[0]*10
# print(h_s)
dp = [float("inf")]*(N+10)
dp[0] = 0

for i in range(N):
    for j in range(1, 3):
        dp[i+j] = min(dp[i+j], dp[i]+abs(h_s[i]-h_s[i+j]))

print(dp[N-1])
Problem p02947 (python)

Fixed submission:
import collections
from math import factorial

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under



N = int(input())
S = [input() for i in range(N)]

for i in range(N):
    S[i] = ''.join(sorted(S[i]))

c = collections.Counter(S)
values, counts = zip(*c.most_common())
counts = [i for i in counts if i > 1]

ans = 0
for c in counts:
    ans += cmb(c, 2)
print(int(ans))

Buggy submission (verdict: Runtime Error):
import collections
from math import factorial

N = int(input())
S = [input() for i in range(N)]

for i in range(N):
    S[i] = ''.join(sorted(S[i]))

c = collections.Counter(S)
values, counts = zip(*c.most_common())
counts = [i for i in counts if i > 1]

ans = 0
for c in counts:
    ans += factorial(c) / factorial(2) / factorial(c - 2)
print(int(ans))
Problem p03067 (python)

Fixed submission:
data = input()
split = data.split(' ')
a = int(split[0])
b = int(split[1])
c = int(split[2])

if b < a:
    a, b = b, a

for i in range(a, b):
    judge = 'No'
    if i == c:
        judge = 'Yes'
        break

print(judge)

Buggy submission (verdict: Runtime Error):
data = input()
split = data.split(' ')
a = int(split[0])
b = int(split[1])
c = int(split[2])
if c < a:
    a, b = b, a
for i in range(a, b):
    if i == c:
        judge = 'Yes'
        break
    else:
        judge = 'No'

print(judge)
Problem p03069 (python)

Fixed submission:
N = input()
S = input()
count = 0

list_str = S
count_black = 0
count_white = S.count('.')
ans = count_black + count_white

for i in S:
    if i == '#':
        count_black += 1
    else:
        count_white -= 1

    if ans >= count_white + count_black:
        ans = count_black + count_white

# print(count_black)
# print(count_white)

print(ans)

Buggy submission (verdict: Runtime Error):
def test():
    global count, list_str
    for i, data in enumerate(list_str):
        try:
            if data == '#' and list_str[i + 1] == '.':
                list_str[i + 1] = '#'
                count += 1
                test()
        except IndexError:
            pass


N = input()
S = input()
count = 0

list_str = list(S)


test()

# print(list_str)
print(count)
Problem p03210 (python)

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

Buggy submission (verdict: Runtime Error):
x=int(input())
if x==3 or x==5 or x==7:
	print("YES:)
else:
	print("NO")
Problem p03219 (python)

Fixed submission:
x,y=map(int,input().split())
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x,y=input().split()
print(x+y/2)