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

Fixed submission:
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
      if len(s[k:l+k+1])==z:
        break
print(sorted(set(d))[z-1])

Buggy submission (verdict: Runtime Error):
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
flag = 0
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
  if len(d)==z:
    break
print(sorted(set(d))[z-1])

Buggy submission (verdict: Runtime Error):
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
flag = 0
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
  if len(d)==k:
    break
print(sorted(set(d))[z-1])

Buggy submission (verdict: Runtime Error):
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
flag = 0
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
  if len(d)==k:
    break
print(sorted(set(d))[z-1])
Problem p03354 (python)

Fixed submission:
N, M = map(int, input().split())
p = list(map(lambda x: int(x) - 1, input().split()))
class UnionFind:
  def __init__(self, n):
    self.table = [-1 for _ in range(n)]
    
  def root(self, x):
    if self.table[x] < 0:
      return x
    else:
      self.table[x] = self.root(self.table[x])
      return self.table[x]
  
  def unite(self, x, y):
    s1, s2 = self.root(x), self.root(y)
    if s1 != s2:
      if self.table[s1] != self.table[s2]:
        if self.table[s1] < self.table[s2]:
          self.table[s2] = s1
        else:
          self.table[s1] = s2
      else:
        self.table[s1] += -1
        self.table[s2] = s1
    return
  
  def findSet(self, x, y):
    return self.root(x) == self.root(y)
uf = UnionFind(N)
for i in range(M):
  px, py = map(int, input().split())
  px -= 1
  py -= 1
  uf.unite(px, py)
ans = 0
for i, v in enumerate(p):
  if uf.findSet(i,v):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
p = list(map(lambda x: int(x) - 1, input().split()))
class UnionFind:
  def __init__(self, n):
    self.table = [-1 for _ in range(n)]
    
  def root(self, x):
    if self.table[x] < 0:
      return x
    else:
      return self.table[x] = self.root(self.table[x])
  
  def unite(self, x, y):
    s1, s2 = self.root(x), self.root(y)
    if s1 != s2:
      if self.table[s1] != self.table[s2]:
        if self.table[s1] < self.table[s2]:
          self.table[s2] = s1
        else:
          self.table[s1] = s2
      else:
        self.table[s1] += -1
        self.table[s2] = s1
    return
  
  def find Set(self, x, y):
    return self.root(x) == self.root(y)
uf = UnionFind(N)
for i in range(M):
  px, py = map(int, input().split())
  px -= 1
  py -= 1
  uf.unite(px, py)
ans = 0
for i, v in enumerate(p):
  if uf.findSet(i,v):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
flag = 0
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
  if len(d)==k:
    break
print(sorted(set(d))[z-1])
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int,input().split())
fx = x
fy = y
fl = 0
val = int(0)
fmin = min(x,y)
if a>2*c:
  x = 0
  y = y - fx
  val += 2*c*fx
  fl += 1
if y < 0:
  y = 0
if b>2*c:
  if fl == 1:
    val += 2*c*y
    y = 0
  else:
    val += 2*c*y
    x = x -y
    y = 0 
if x < 0:
  x = 0
nx = x
ny = y
if a+b>2*c:
  x = x - min(nx,ny)
  y = y - min(nx,ny)
  val += 2*c*min(nx,ny)
print(val+a*x+b*y)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
fx = x
fy = y
fl = 0
val = int(0)
fmin = min(x,y)
if a>2*c:
  val += 2*c*x
  y = y - x
  x = 0
  fl += 1
if y<0:
  y=0
if b>2*c:
  if fl == 1:
    val += 2*c*y
    y = 0
  else:
    val += 2*c*y
    x = x - y
    y = 0 
if x<0:
  nx = 0
else:
  nx = x
if y<0:
  ny = 0
else:
  ny = y
if a+b>2*c:
  nnx = nx - min(nx,ny)
  nny = ny - min(nx,ny)
  val += 2*c*min(nx,ny)
print(val+a*nnx+b*nny)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a*b%2 == 1:
  print('Odd')
else:
  print('Even')

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

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

Buggy submission (verdict: Runtime Error):
a,b,t=input().split()
print(math.factorial(t//a)*b)
Problem p03285 (python)

Fixed submission:
import sys
N = int(input())

for i in range((N // 4)+1):
    for j in range((N // 7)+1):
        if 4 * i + 7 * j == N:
            print("Yes")
            sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
if (N % 7) % 4 == 0 or (N % 4) % 7 == 0:
    print("Yes")
else:
    print("No")
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())

print(int((a+b)/2*h))

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

print(int((a+b)/2*h)
Problem p02947 (python)

Fixed submission:
from sys import stdin
from itertools import groupby
n = int(stdin.readline().rstrip())
sary = sorted(["".join(sorted(stdin.readline().rstrip())) for _ in range(n)])

gr = groupby(sary)

res = 0

for k, g in gr:
    num = len(list(g))
    if  num >= 2:
        res += num * (num - 1) // 2

print(res)

Buggy submission (verdict: Runtime Error):
from sys import stdin
from itertools import groupby
n = int(stdin.readline().rstrip())
sary = [sorted(stdin.readline().rstrip()) for _ in range(n)]

gr = groupby(sary.sort())

res = 0

for k, g in gr:
    if k >= 2:
        res += k * (k - 1) // 2

print(res)
Problem p02953 (python)

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
h = list(map(int, stdin.readline().rstrip().split(' ')))

if n == 1:
    print("Yes")
    exit()
for i in range(n-2, -1, -1):
    if h[i] - h[i+1] == 1:
        h[i] -= 1
    elif h[i] - h[i+1] > 1:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
from sys import stdin

n = int(stdin.readline().rstrip())
h = list(map(int, stdin.readline().rstrip().split(' ')))

if n == 1:
    print("Yes")
    exit()
for i in range(n-1, -1, -1):
    if h[i] - h[i+1] == 1:
        h[i] -= 1
    elif h[i] - h[i+1] > 1:
        print("No")
        exit()
print("Yes")
Problem p03309 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split(' ')))

p = sorted([v - (i + 1) for i, v in enumerate(A)])

if len(p) >= 3:
    res = min(sum(map(abs, [i - p[N//2] for i in p])), sum(map(abs, [i - p[N//2-1] for i in p])), sum(map(abs, [i - p[N//2+1] for i in p])))
elif len(p) >= 2:
    res = min(sum(map(abs, [i - p[0] for i in p])), sum(map(abs, [i - p[1] for i in p])))
else:
    res = 0
print(int(res))

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

p = sorted([v - (i + 1) for i, v in enumerate(A)])

res = min(sum(map(abs, [i - p[N//2] for i in p])), sum(map(abs, [i - p[N//2-1] for i in p])), sum(map(abs, [i - p[N//2+1] for i in p])))
print(int(res))
Problem p03353 (python)

Fixed submission:
s = input()
K = int(input())
Kinds = set(s)
sort_s = sorted(list(Kinds))
cand = set([]) | set(sort_s)
for h in sort_s:
    first_i = [i for i, c in enumerate(s) if c == h]
    for i in first_i:
        for j in range(1, 5):
            if i+j+1 <= len(s):
                cand.add(s[i:i+j+1])

sort_res = sorted(list(cand))

print(sort_res[K-1])

Buggy submission (verdict: Runtime Error):
s = input()
K = int(input())
Kinds = set(s)
sort_s = sorted(list(Kinds))
cand = set([]) | set(sort_s)

first_i = [i for i, c in enumerate(s) if c == sort_s[0]]
for i in first_i:
    for j in range(1, 5):
        if i+j+1 <= len(s):
            cand.add(s[i:i+j+1])

sort_res = sorted(list(cand))

print(sort_res[K-1])
Problem p03363 (python)

Fixed submission:
import numpy
N = int(input())
ary = list(map(int, input().split(' ')))
ary_int = numpy.cumsum(ary).tolist()
ary_int.sort()
ary_int.append(float('inf'))

count = 0
same_count = 0
for i in range(N):
    if ary_int[i] == ary_int[i+1]:
        same_count += 1
    else:
        count += same_count * (same_count + 1) // 2
        same_count = 0
count += ary_int.count(0)
print(int(count))

Buggy submission (verdict: Runtime Error):
import numpy
N = int(input())
ary = list(map(int, input().split(' ')))
count = 0
zero_count = 0
for i in range(N):
    if ary[0] == 0:
        zero_count += 1
        ary.pop(0)
        continue
    elif ary[0] == ary[1]:
        ary.pop(0)
        continue
    else:
        if zero_count != 0:
            count += zero_count * (zero_count + 1) / 2
            zero_count = 0
        ary_int = numpy.cumsum(ary)
        count += ary_int.tolist().count(0)
        ary.pop(0)
if zero_count != 0:
    count += zero_count * (zero_count + 1) / 2
    zero_count = 0

print(int(count))
Problem p03409 (python)

Fixed submission:
# -- coding: utf-8 --
from collections import deque
N = int(input())
red = []
for i in range(N):
    red.append(list(map(int, input().split(' '))))
blue = []
for i in range(N):
    blue.append(list(map(int, input().split(' '))))
red = deque(sorted(red, key=lambda x:(x[1], x[0]), reverse=True))
blue = deque(sorted(blue))
count = 0
flag = [0] * N
for b in blue:
    for i, r in enumerate(red):
        if r[0] < b[0] and r[1] < b[1] and flag[i] == 0:
            count += 1
            flag[i] = 1
            break

print(count)

Buggy submission (verdict: Runtime Error):
# -- coding: utf-8 --
from collections import deque
N = int(input())
red = []
for i in range(N):
    red.append(list(map(int, input().split(' '))))
blue = []
for i in range(N):
    blue.append(list(map(int, input().split(' '))))
red.sorted()
blue.sorted()
red = deque(red)
blue = deque(blue)
count = 0
flag = [0] * N
for b in blue:
    for i, r in enumerate(red):
        if r[0] < b[0] and r[1] < b[1] and flag[i] == 0:
            count += 1
            flag[i] = 1

print(count)
Problem p03625 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split(' ')))
rod = {}
for i in A:
    if i in rod:
        rod[i] += 1
    else:
        rod[i] = 1
if len([i for i in rod.values() if i >= 2]) < 2:
    print(0)
else:
    length4 = [k for k, v in rod.items() if v >= 4]
    length4.sort()
    length2 = [k for k, v in rod.items() if v >= 2]
    length2.sort()
    if len(length4) > 0 and length4[-1] == length2[-1]:
        print(length4[-1]**2)
    else:
        print(length2[-2] * length2[-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
rod = {}
for i in A:
    if i in rod:
        rod[i] += 1
    else:
        rod[i] = 1
if len([i for i in rod.values() if i >= 2]) < 2:
    print(0)
else:
    length4 = [k for k, v in rod.items() if v >= 4]
    length4.sort()
    length2 = [k for k, v in rod.items() if v >= 2]
    length2.sort()
    if length4[-1] == length2[-1]:
        print(length4[-1]**2)
    else:
        print(length2[-2] * length2[-1])
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split(' ')))
b = [0] * n
K = [0] * n
for i in range(n):
    if i % 2 == 0: K[i] = i
    else: K[i] = -1 * (i + 1)

if n % 2 == 0:
    for i in range(n):
        b[(n+K[i])//2] = a[i]
else:
    for i in range(n):
        b[(n-K[i]-1)//2] = a[i]

print(' '.join(map(str, b)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split(' ')))
b = [0] * n
K = [0] * n
def hopping(j):
    if j == 1: return 0
    else:
        K[j-1] = ((-1)**(j-1))*2*(j-1)+hopping(j-1)
        return K[j-1]

hopping(n)

if n % 2 == 0:
    for i in range(n):
        b[(n+K[i])//2] = a[i]
else:
    for i in range(n):
        b[(n-K[i]-1)//2] = a[i]
print(b)
Problem p03695 (python)

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i <= 400 * j + 399:
                c[j] += 1

res = len([i for i in c[:-1] if i > 0])
print(1 if res == 0 else res, res + c[-1])

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i < 400 * j + 399:
                c[j] += 1

if c[8] > 0:
    resmin = len([i for i in c[:8] if i > 0])
    if resmin == 0:
        resmin = 1
    resmax = resmin + c[8] % (8 - resmin)
    print(str(resmin) + ' ' + str(resmax))
else:
    res = len([i for i in c if i > 0])
    print(str(res) + ' ' + str(res))
Problem p03719 (python)

Fixed submission:
A,B,C = map(int, input().split(' '))
if A <= C <= B: print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int. input().split(' '))
if A <= C <= B: print('Yes')
else: print('No')
Problem p03944 (python)

Fixed submission:
W, H, N = map(int, input().split(' '))
minx = 0
maxx = W
miny = 0
maxy = H
for i in range(N):
    x, y, a = map(int, input().split(' '))
    if a == 1:
        minx = max(minx, x)
    elif a == 2:
        maxx = min(maxx, x)
    elif a == 3:
        miny = max(miny, y)
    else:
        maxy = min(maxy, y)
if minx <= maxx and miny <= maxy:
    print((maxx-minx) * (maxy-miny))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
 W, H, N = map(int, input().split(' '))
minx = 0
maxx = W
miny = 0
maxy = H
for i in range(N):
    x, y, a = map(int, input().split(' '))
    if a == 1:
        minx = max(minx, x)
    elif a == 2:
        maxx = min(maxx, x)
    elif a == 3:
        miny = max(miny, y)
    else:
        maxy = min(maxy, y)
if minx <= maxx and miny <= maxy:
    print((maxx-minx) * (maxy-miny))
else:
    print(0)
Problem p03039 (python)

Fixed submission:
N, M, K = map(int, input().split())
ans=0
mod = 10**9+7 #出力の制限
max = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, max + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
for d in range(1,N):
    ans += d*(N-d)*M**2 % mod
for d in range(1,M):
    ans += d*(M-d)*N**2 % mod
ans = ans*cmb(N*M-2, K-2, mod) % mod
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
mod = 10**9+7
ans = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

for d in range(1,N):
    ans += d*(N-d)*M**2 % mod
for d in range(1,M):
    ans += d*(M-d)*N**2 % mod
ans *= cmb(N*M-2, K-2, mod) % mod
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
mod = 10**9+7
ans = 0
def combination(a,b, mod):
    b = min(b, a-b)
    ans = 1
    for i in range(0,b):
        ans *= (a-i)/(i+1) % mod
    return int(ans)
for d in range(1,N):
    ans += d*(N-d)*M**2 % mod
for d in range(1,M):
    ans += d*(M-d)*N**2 % mod
ans *= combination(N*M-2, K-2, mod) % mod
print(ans)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
from fractions import gcd
N = int(input())
Alist = [0]+list(map(int, input().split()))+[0]
Rlist = [0]*(N+2)
Llist = [0]*(N+1)
for i in range(N):
    Llist[i+1] = gcd(Llist[i], Alist[i])
    Rlist[N-i] = gcd(Rlist[N-i+1], Alist[N-i+1])
print(max([gcd(Rlist[i], Llist[i]) for i in range(1,N+1)]))
Problem p03076 (python)

Fixed submission:
times = [int(input()) for _ in range(5)]
times1 = []
total = 0
for t in times:
  t1 = t % 10
  if t1 == 0:
    total += t
  else:
    times1.append(t1)
    total += (t//10 + 1) * 10
if len(times1) >= 1:
    total = total + min(times1) - 10
print(total)

Buggy submission (verdict: Runtime Error):
times = [int(input()) for _ in range(5)]
times1 = []
total = 0
for t in times:
  t1 = t % 10
  if t1 == 0:
    total += t
  else:
    times1.append(t1)
    total += (t//10 + 1) * 10
if len(times) >= 1:
    total = total + min(times1) - 10
print(total)
Problem p03085 (python)

Fixed submission:
b = input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'G':
    print('C')
else:
    print('G')

Buggy submission (verdict: Runtime Error):
N, Q = map(int,input().split())
S = input()
LRlist = []
for i in range(Q):
    LRlist.append(list(map(int,input().split())))
indexlist = []
for i in range(len(S)-1):
    if S[i] == 'A':
        if S[i+1] == 'C':
            indexlist.append(i)
for LR in LRlist:
    L = LR[0]
    R = LR[1]
    answer = 0
    for i in indexlist:
        if L - 1 <= i:
            if i <= R - 2:
                answer += 1
        elif R - 2 < i:
            break
    print(answer)

Buggy submission (verdict: Runtime Error):
b = input()
if b == 'A':
    print('C')
elif b == 'C':
    print('A')
elif b == 'G':
    print('T')
else b == 'T':
    print('G')
Problem p03088 (python)

Fixed submission:
N, MOD = int(input()), 10**9+7
memo = [{} for i in range(N+1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return  False
    return True

def dfs(cur, last3):
    #メモ化
    if last3 in memo[cur]:
        return memo[cur][last3]
    #最後までたどり着いた数列
    if cur == N:
        return 1
    #漸化式計算
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))

Buggy submission (verdict: Runtime Error):
def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return  False
    return True

def dfs(cur, last3):
    #メモ化
    if last3 in memo[cur]:
        return memo[cur][last3]
    #最後までたどり着いた数列
    if cur == N:
        return 1
    #漸化式計算
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))

Buggy submission (verdict: Runtime Error):
N, MOD = int(input()), 10**9+7
memo = [{} fot i in range(N+1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return  False
    return True

def dfs(cur, last3):
    #メモ化
    if last3 in memo[cur]:
        return memo[cur][last3]
    #最後までたどり着いた数列
    if cur == N:
        return 1
    #漸化式計算
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
if N % 500 =< A:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
if N % 500 =< A:
    print('YES')
else:
    print('NO')
Problem p03469 (python)

Fixed submission:
day = input()
day = day.replace('2017','2018')
print(day)

Buggy submission (verdict: Runtime Error):
#バケット法による解
N = int(input())
dlist = []
for i in range(N):
    dlist.append(int(input()))
dbacket = [0]*100
for d in dlist:
    dbacket[d] += 1
answer = 0
for db in dbacket:
    if db > 0:
        answer += 1
print(answer)
Problem p03470 (python)

Fixed submission:
N = int(input())
dlist = []
for i in range(N):
    dlist.append(int(input()))
dset = set(dlist)
print(len(dset))

Buggy submission (verdict: Runtime Error):
#バケット法による解
N = int(input())
dlist = []
for i in range(N):
    dlist.append(int(input()))
dbacket = [0]*100
for d in dlist:
    dbacket[d] += 1
answer = 0
for db in dbacket:
    if db > 0:
        answer += 1
print(answer)
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
N = a+b
if N % 2 = 0:
    print(N//2)
else:
    print((N+1)//2)
Problem p03493 (python)

Fixed submission:
L = input()
n=0
for i in range(len(L)):
    if int(L[i]) ==1:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
B=A[:]
i=0
while i < N:
    if A[i] % 2 == 0:
        A[i] = A[i]//2
        if i == N - 1:
            B = A[:]
            i = -1
        i += 1
    else:
        break
print(B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
B=A[:]
i=0
while i < N:
    if A[i] % 2 == 0:
        A[i] = A[i]//2
        print(A[i])
        if i == N - 1:
            B = A[:]
            i = -1
        i += 1
    else:
        break
print(B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
B=A[:]
i=0
while i < N:
    if A[i] % 2 == 0:
        A[i] = A[i]//2
        print(A[i])
        if i == N - 1:
            B = A[:]
            i = -1
        i += 1
    else:
        break
print(B)

Buggy submission (verdict: Runtime Error):
list = list(input())
for i in len(list):
    n = 0:
    if int(list[i]) ==1:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
list = list(input())
for i in len(list):
    n = 0:
    if int(list[i]) ==1:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
list = list(input())
for i in len(list):
    n = 0:
    if int(list[i]) ==1:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
list = list(input())
for i in len(list):
    n = 0:
    if int(list[i]) ==1:
        n =+ 1
print(n)

Buggy submission (verdict: Runtime Error):
list = list(input())
for i in len(list):
    n = 0:
    if list[i] ==1:
        n =+ 1
print(n)
Problem p03624 (python)

Fixed submission:
S = set(list(input()))
alpha = set([chr(ord('a') + i) for i in range(26)])
answer = alpha - S
L=list(answer)
if len(L) == 0:
    print('None')
else:
    L.sort()
    print(L[0])

Buggy submission (verdict: Runtime Error):
S = set(list(input()))
alpha = set([chr(ord('a') + i) for i in range(26)])
answer = alpha - S
L=list(answer)
L.sort()
if len(L) = 0:
    print('None')
else:
    print(L[0])

Buggy submission (verdict: Runtime Error):
S = set(list(input()))
alpha = set([chr(ord('a') + i) for i in range(26)])
answer = alpha - S
L=list(answer)
L.sort()
print(L[0])
Problem p03658 (python)

Fixed submission:
N, K = map(int, input().split())
L = list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[:K]))

Buggy submission (verdict: Runtime Error):
K, N = map(int, input().split())
L = list(map(int, input().split())).sort(reverse=True)
print(sum(L[:K]))
Problem p03693 (python)

Fixed submission:
r,g,b = input().split()
number=int(r+g+b)
if number % 4 ==0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(map, input().split())
number=int(r+g+b)
if number % 4 ==0:
    print('YES')
else:
    print('NO')