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

Fixed submission:
#21:10
h,w = map(int,input().split())
raw = []
for x in range(h):
  raw.append(input())
xx = []
for x in range(h):
  now = []
  tmp = 0
  for y in range(w):
    if raw[x][y] == '.':
      tmp += 1
    else:
      now += [tmp] * tmp
      tmp = 0
      now.append(0)
  now += [tmp] * tmp
  xx.append(now)
yy = []
for y in range(w):
  now = []
  tmp = 0
  for x in range(h):
    if raw[x][y] == '.':
      tmp += 1
    else:
      now += [tmp] * tmp
      tmp = 0
      now.append(0)
  now += [tmp] * tmp
  yy.append(now)
'''
for x in range(h):
  print(xx[x])
for y in range(w):
  print(yy[y])
'''
maxi = 0
for x in range(h):
  for y in range(w):
    maxi = max(maxi,xx[x][y]+yy[y][x]-1)
print(maxi)

Buggy submission (verdict: Runtime Error):
#00:27
h,w = map(int,input().split())
raw = []
for _ in range(h):
  raw.append(input())
ver = [[] for _ in range(w)]
hrz = [[] for _ in range(w)]
for x in range(h):
  st = 0
  for y in range(w):
    if raw[x][y] == '#':
      for k in range(st,y):
        ver[x].append(y-st)
      ver[x].append(0)
      st = y + 1
  for k in range(st,w):
    ver[x].append(w-st)
#print(ver)
for y in range(w):
  st = 0
  for x in range(h):
    if raw[x][y] == '#':
      for k in range(st,x):
        hrz[k].append(x-st)
      hrz[x].append(0)
      st = x + 1
  for k in range(st,h):
    hrz[k].append(h-st)
#print(hrz)
ans = 0
for x in range(h):
  for y in range(w):
    ans = max(ans,ver[x][y]+hrz[x][y]-1)
print(ans)

Buggy submission (verdict: Runtime Error):
#00:27
h,w = map(int,input().split())
raw = []
for _ in range(h):
  raw.append(input())
ver = [[] for _ in range(w)]
hrz = [[] for _ in range(w)]
for x in range(h):
  st = 0
  for y in range(w):
    if raw[x][y] == '#':
      for k in range(st,y):
        ver[x].append(y-st)
      ver[x].append(0)
      st = y + 1
  for k in range(st,w):
    ver[x].append(w-st)
#print(ver)
for y in range(w):
  st = 0
  for x in range(h):
    if raw[x][y] == '#':
      for k in range(st,x):
        hrz[k].append(x-st)
      hrz[x].append(0)
      st = x + 1
  for k in range(st,h):
    hrz[k].append(h-st)
#print(hrz)
ans = 0
for x in range(h):
  for y in range(w):
    ans = max(ans,ver[x][y]+hrz[x][y]-1)
print(ans)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
whole = [input() for _ in range(h)]
result = []
for hi in range(h):
  old = whole[hi]
  now = 0
  tmp = 0
  new = []
  while now < w:
    if old[now] == '#':
      new += [tmp]*tmp
      new += [0]
    else:
      tmp += 1
    now += 1
  new += [tmp]*tmp
  result.append(new)
print(result)
twhole = list(map(lambda x:[x],whole[0]))
print(twhole)
for hi in range(1,h):
  low = whole[hi]
  for wi in range(w):
    twhole[wi].append(h[wi])
print(twhole)
Problem p03026 (python)

Fixed submission:
#解説チラ見
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append(b)
  peer[b].append(a)
now = [0]
scr = list(map(int,input().split()))
scr.sort()
scr.reverse()
ans = [0 for _ in range(n)]
ans[0] = scr[0]
pin = 1
while now:
  last = now
  now = []
  for x in last:
    for y in peer[x]:
      if ans[y] == 0:
        ans[y] = scr[pin]
        pin += 1
        now.append(y)
print(sum(scr[1:]))
print(' '.join(list(map(str,ans))))

Buggy submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
m = 10**9+7
def inv(x):
  m = 10**9+7
  t = x
  y = 1
  while True:
    if t == 1:
      break
    y *= m // t
    t = m % t
    y *= -1
    y %= m
  return y
def c(x,y):
  t = 1
  for j in range(y):
    t *= x-j
    t *= inv(j+1)
  return t
for i in range(1,k+1):
  print( (c(k-1,i-1) * c(n-k+1,i)) % m )
Problem p03029 (python)

Fixed submission:
a,p = map(int,input().split())
print((3*a+p)//2)

Buggy submission (verdict: Runtime Error):
#17:09
n,k = map(int,input().split())
v = list(map(int,input().split()))
'''
左からa個
右からb個
k-a-b個以内捨てて良し
'''
can = []
nk = min(n,k)
for a in range(nk+1):
  if a != 0:
    x.append(v[a-1])
  else:
    x = []
  for b in range(nk+1-a):
    if b != 0:
      y.append(v[-b])
    else:
      y = []
    z = x + y
    z.sort()
    r = k - a - b
    tmp = 0
    if r < a+b:
      if z[r] < 0:
        for i in range(r,a+b):
          tmp += z[i]
      else:
        for i in range(a+b):
          if z[i] >= 0:
            tmp += z[i]
    else:
      for i in range(a+b):
        if z[i] >= 0:
          tmp += z[i]
    can.append(tmp)
print(max(can))
Problem p03031 (python)

Fixed submission:
n,m = map(int,input().split())
ls = []
for _ in range(m):
  tmp = list(map(int,input().split()))[1:]
  lls = []
  for i in range(1,n+1):
    lls += [int(i in tmp)]
  ls += [lls]
p = list(map(int,input().split()))
count = 0
yyy = [0]*n
while True:
  if yyy[-1] == 2:
    break
  dd = 0
  for mi in range(m):
    c = 0
    for ni in range(n):
      c += ls[mi][ni] * yyy[ni]
    d = c%2
    dd += 1-int(d==p[mi])
  if dd == 0:
    count += 1
  yyy[0] += 1
  for j in range(0,n-1):
    if yyy[j] == 2:
      yyy[j] = 0
      yyy[j+1] += 1
print(count)

Buggy submission (verdict: Runtime Error):
while True:
  must1 = 1
  for mi in range(m):
    onoff = 0
    for ni in range(n):
      onoff += li[mi][ni]*yyy[ni]
    should1 = bool(onoff%2 == p[mi])
    must1 *= should1
  if must1 == 1:
    score += 1
  yyy[0] += 1
  for ni in range(n-1):
    if yyy[ni] == 2:
      yyy[ni] = 0
      yyy[ni+1] += 1
  if yyy[n-1] == 2:
    break
print(score)
Problem p03032 (python)

Fixed submission:
#17:09
n,k = map(int,input().split())
v = list(map(int,input().split()))
'''
左からa個
右からb個
k-a-b個以内捨てて良し
'''
can = []
nk = min(n,k)
for a in range(nk+1):
  if a != 0:
    x.append(v[a-1])
  else:
    x = []
  for b in range(nk+1-a):
    if b != 0:
      y.append(v[-b])
    else:
      y = []
    z = x + y
    z.sort()
    r = k - a - b
    tmp = 0
    if r < a+b:
      if z[r] < 0:
        for i in range(r,a+b):
          tmp += z[i]
      else:
        for i in range(a+b):
          if z[i] >= 0:
            tmp += z[i]
    else:
      for i in range(a+b):
        if z[i] >= 0:
          tmp += z[i]
    can.append(tmp)
print(max(can))

Buggy submission (verdict: Runtime Error):
#12:10
n,k = map(int,input().split())
v = list(map(int,input().split()))
can = []
for i in range(n):
  if i == 0:
    a = []
  elif i <= k:
    a.append(v[i-1])
  for j in range(n):
    if j == 0:
      b = []
    elif i + j <= n and i + j <= k:
      b.append(v[-j])
    rest = min(k-i-j,i+j)
    c = a + b
    c.sort()
    tmp = sum(c)
    for de in range(rest):
      if c[de] < 0:
        tmp -= c[de]
    can.append(tmp)
    #print(i,j,a,b,tmp)
print(max(can))

Buggy submission (verdict: Runtime Error):
#17:09
n,k = map(int,input().split())
v = list(map(int,input().split()))
'''
左からa個
右からb個
k-a-b個以内捨てて良し
'''
can = []
x = []
for a in range(k):
  if a != 0:
    x.append(v[a-1])
  y = []
  for b in range(k):
    if b != 0:
      y.append(v[-b])
    if a + b <= min(n,k):
      z = x + y
      z.sort()
      r = k - a - b
      tmp = 0
      if r < a+b:
        if z[r] < 0:
          for i in range(r,a+b):
            tmp += z[i]
        else:
          for i in range(a+b):
            if z[i] > 0:
              tmp += z[i]
      else:
        for i in range(r,a+b):
          if z[i] > 0:
            tmp += z[i]
      can.append(tmp)
print(max(can))
Problem p03044 (python)

Fixed submission:
#21:30
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b,x = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append([b,x])
  peer[b].append([a,x])
ans = [-1 for _ in range(n)]
now = [0]
while now != []:
  last = now
  now = []
  for x in last:
    for yz in peer[x]:
      y = yz[0]
      z = yz[1]
      if ans[y] == -1:
        ans[y] = (ans[x] + z) % 2
        now.append(y)
  #print(now)
for i in range(n):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
#21:30
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b,x = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append([b,x])
  peer[b].append([a,x])
ans = [-1 for _ in range(n)]
now = [0]
while now != []:
  last = now
  now = []
  for x in last:
    for yz in peer[x]:
      y = yz[0]
      z = yz[1]
      if ans[y] == -1:
        ans[y] = (ans[x] + z) % 2
        now.append(y)
  #print(now)
for i in range(n):
  print(ans[now])

Buggy submission (verdict: Runtime Error):
#21:30
n = int(input())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b,x = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append([b,x])
  peer[b].append([a,x])
ans = [-1 for _ in range(n)]
now = [0]
while now != []:
  last = now
  now = []
  for x in last:
    for yz in peer[x]:
      y = yz[0]
      z = yz[1]
      if ans[y] == -1:
        ans[y] = (ans[x] + z) % 2
        now.append(y)
  #print(now)
for i in range(n):
  print(now[i])
Problem p03047 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
S = input()
h = 'o'
if S[k-1] == 'A':
  h = 'a'
elif S[k-1] == 'B':
  h = 'b'
else:
  h = 'c'
print(S[:k-1]+h+S[k:])
Problem p03050 (python)

Fixed submission:
#19:32
n = int(input())
ans = 0
if n == 1:
  print(0)
else:
  for i in range(1,int(n**.5)+1):
    if n % i == 0:
      x = n // i - 1
      if n // x == n % x == i:
        ans += x
        #print(x)
  print(ans)

Buggy submission (verdict: Runtime Error):
#19:32
n = int(input())
ans = 0
for i in range(1,int(n**.5)+1):
  if n % i == 0:
    x = n // i - 1
    if n // x == n % x == i:
      ans += x
      #print(x)
print(ans)
Problem p03061 (python)

Fixed submission:
import fractions
N = int(input())
A = list(map(int,input().split()))
hard = fractions.gcd(A[0],A[1])
easy = [A[0],A[1]]
del A[0]
del A[0]
while len(A) != 0:
  easyt1 = fractions.gcd(easy[0],A[0])
  easyt2 = fractions.gcd(easy[1],A[0])
  easyt3 = hard
  easy = sorted([easyt1,easyt2,easyt3])[1:3]
  hard = fractions.gcd(hard,A[0])
  del A[0]
print(max(easy))

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int,input().split()))
hard = fractions.gcd(A[0],A[1])
easy = [A[0],A[1]]
del A[0],A[1]
while len(A) != 0:
  easyt1 = fractions.gcd(easy[0],A[0])
  easyt2 = fractions.gcd(easy[1],A[0])
  easyt3 = hard
  easy = sorted([easyt1,easyt2,easyt3])[1:3]
  hard = fractions.gcd(hard,A[0])
  del A[0]
print(max(easy))
Problem p03067 (python)

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

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

Fixed submission:
A,B = map(int,input().split())
if A > B:
  print(2*A-1)
if A == B:
  print(A+B)
if A < B:
  print(2*B-1)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[0] == '0':
  divide = []
else:
  divide = [0]
tmp = 1
for i in range(1,N):
  if S[i] == S[i-1]:
    tmp += 1
  else:
    divide += [tmp]
    tmp = 1
divide += [tmp]
le = len(divide)
zero = [0]*2*le + divide + [0]*2*le
su = [0]
for i in range(0,5*le):
  su += [su[-1]+zero[i]]
del su[0]
lle = len(su)
mxm = 0
for k in range(K,lle):
  if 2*k+1 >= lle:
    break
  cd = su[2*k+1] - su[2*k-2*K]
  if cd > mxm:
    mxm = cd
print(mxm)
Problem p03074 (python)

Fixed submission:
N,K = map(int,input().split())
S = input()
if S[0] == '0':
  divide = []
else:
  divide = [0]
tmp = 1
for i in range(1,N):
  if S[i] == S[i-1]:
    tmp += 1
  else:
    divide += [tmp]
    tmp = 1
divide += [tmp]
le = len(divide)
zero = [0]*2*le + divide + [0]*2*le
su = [0]
for i in range(0,5*le):
  su += [su[-1]+zero[i]]
del su[0]
lle = len(su)
mxm = 0
for k in range(K,lle):
  if 2*k+1 >= lle:
    break
  cd = su[2*k+1] - su[2*k-2*K]
  if cd > mxm:
    mxm = cd
xmx = max(divide)
print(max(mxm,xmx))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()
if S[0] == '0':
  divide = []
else:
  divide = [0]
tmp = 1
for i in range(1,N):
  if S[i] == S[i-1]:
    tmp += 1
  else:
    divide += [tmp]
    tmp = 1
divide += [tmp]
le = len(divide)
zero = [0]*2*le + divide + [0]*2*le
su = [0]
for i in range(0,5*le):
  su += [su[-1]+zero[i]]
del su[0]
lle = len(su)
mxm = 0
for k in range(K,lle):
  if 2*k+1 > lle:
    break
  cd = su[2*k+1] - su[2*k-2*K]
  if cd > mxm:
    mxm = cd
print(mxm)
Problem p03076 (python)

Fixed submission:
A,B,C,D,E = [int(input()) for _ in range(5)]
a = (10-A) % 10
b = (10-B) % 10
c = (10-C) % 10
d = (10-D) % 10
e = (10-E) % 10
if a == b == c == d == e == 0:
  print(A+B+C+D+E)
else:
  print(A+B+C+D+E+a+b+c+d+e-max(a,b,c,d,e))

Buggy submission (verdict: Runtime Error):
A,B,C,D,E = [int(input()) for _ in range(5)]
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10
if a == b == c == d == e == 0:
  print(A+B+C+D+E)
else:
  print(A-a+B-b+C-c+D-d+E-e-max(10-a,10-b,10-c,10-d,10-e)
Problem p03103 (python)

Fixed submission:
N,M = map(int,input().split())
ab = []
for i in range(N):
  ab += [list(map(int,input().split()))]
ab.sort()
rest = M
cost = 0
while True:
  if rest - ab[0][1] <= 0:
    cost += rest * ab[0][0]
    break
  else:
    rest -= ab[0][1]
    cost += ab[0][0] * ab[0][1]
    del ab[0]
print(cost)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A,B = [],[]
for i in range(N):
  a,b = map(int,input().split())
  A += [a]
  B += [b]
AA = []
BB = []
while True:
  if len(A) == 0:
    break
  else:
    for i in range(len(A)):
      if A[i] == min(A):
        AA += [A[i]]
        BB += [B[i]]
        del A[i]
        del B[i]
rest = M
cost = 0
while True:
  if rest - BB[0] <= 0:
    cost += rest * AA[0]
    break
  else:
    rest -= BB[0]
    cost += AA[0] * BB[0]
    del AA[0]
    del BB[0]
print(cost)
Problem p03110 (python)

Fixed submission:
n = int(input())
sum = 0
for _ in range(n):
  a,b = input().split()
  aa = float(a)
  if b == 'JPY':
    bb = 1
  else:
    bb = 380000.0
  sum += aa*bb
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for _ in range(n):
  a,b = input().split()
  aa = int(a)
  if b == 'JPY':
    bb = 1
  else:
    bb = 380000.0
  sum += aa*bb
print(sum)
Problem p03138 (python)

Fixed submission:
#18:37
n,k = map(int,input().split())
a = list(map(int,input().split()))
now = 2 ** len(bin(k)[2:])
can = 0
while now:
  tmp = 0
  for i in range(n):
    if a[i] ^ now > a[i]:
      tmp += 1
  if tmp * 2 > n:
    can += now
    if can > k:
      can -= now
  now //= 2
ans = 0
for i in range(n):
  ans += a[i] ^ can
#print(can)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
import math
digit = math.floor(math.log2(k)) + 1
stand = sum(a)
ans = []
for i in range(digit):
  add = 2 ** i
  ch = 0
  for j in range(n):
    now = add ^ a[j]
    ch += now
  if ch > stand:
    ans.append(add)
ch = 0
add = sum(ans)
for j in range(n):
  now = add ^ a[j]
  ch += now
print(ch)
Problem p03240 (python)

Fixed submission:
n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] > abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  step += 1
print(' '.join(list(map(str,can[0]))))

Buggy submission (verdict: Runtime Error):
n = int(input())
can = []
xyh = []
for _ in range(n):
  xyh.append(list(map(int,input().split())))
time = 0
while xyh[time][2] == 0:
  time += 1
x,y,h = xyh[time]
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
step = 0
while len(can) != 1:
  x,y,h = xyh[(time + step) % n]
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2]  < abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  step += 1
  if step > n:
    break
print(' '.join(list(map(str,can[0]))))

Buggy submission (verdict: Runtime Error):
n = int(input())
can = []
x,y,h = map(int,input().split())
for i in range(101):
  for j in range(101):
    can.append([i, j, h + abs(x-i) + abs(y-j)])
while len(can) != 1:
  x,y,h = map(int,input().split())
  if h != 0:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2] != h + abs(x-now[0]) + abs(y-now[1]):
        del can[cnt]
      else:
        cnt += 1
  else:
    cnt = 0
    while cnt < len(can):
      now = can[cnt]
      if now[2]  < abs(x-now[0]) + abs(y-now[1]):
        del now
      else:
        cnt += 1
print(' '.join(list(map(str,can[0]))))
Problem p03274 (python)

Fixed submission:
n,k = map(int,input().split())
x = list(map(int,input().split()))
proto = []
for i in range(n-k+1):
  left = x[i]
  right = x[i+k-1]
  al = abs(left)
  ar = abs(right)
  if left * right < 0:
    now = al + ar + min(al,ar)
  else:
    now = max(al,ar)
  proto.append(now)
print(min(proto))

Buggy submission (verdict: Runtime Error):
X,Y = map(int,input().split())
whole = []
for i in range(X):
  now = input()
  if now == '.' * Y:
    pass
  else:
    add = []
    for i in range(Y):
      if now[i] == '.':
        add.append(0)
      else:
        add.append(1)
    whole.append(add)
j = 0
while j < len(whole[0]):
  for i in range(len(whole)):
    if whole[i][j] == 1:
      j += 1
      break
  else:
    for i in range(len(whole)):
      del whole[i][j]
for i in range(len(whole)):
  now = whole[i]
  ans = ''
  for j in range(len(now)):
    if now[j] == 0:
      ans += '.'
    else:
      ans += '#'
  print(ans)
Problem p03281 (python)

Fixed submission:
ans = [105,135,165,189]
n = int(input())
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
elif n < 195:
  print(4)
else:
  print(5)

Buggy submission (verdict: Runtime Error):
ans = [105,135,165,189,195]
n = input()
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
elif n < 195:
  print(4)
else:
  print(5)

Buggy submission (verdict: Runtime Error):
ans = [105,135,165,189]
n = input()
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
else:
  print(4)
Problem p03316 (python)

Fixed submission:
n = input()
N = int(n)
l = len(n)
s = 0
for i in range(l):
  s += int(n[i])
if N % s == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = input()
N = int(n)
l = len(n)
s = 0
for i in range(l):
  s += n[i]
if N % s == 0:
  print('Yes')
else:
  print('No')
Problem p03359 (python)

Fixed submission:
#14:23
a,b = map(int,input().split())
if b >= a:
  print(a)
else:
  print(a-1)

Buggy submission (verdict: Runtime Error):
#14:23
a,b = map(int,input())
if b >= a:
  print(a)
else:
  print(a-1)
Problem p03370 (python)

Fixed submission:
n,x = map(int,input().split())
ans = 0
cheap = []
for i in range(n):
  now = int(input())
  x -= now
  cheap.append(now)
  ans += 1
ans += x // min(cheap)
print(ans)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
ans = 0
cheap = []
for i in range(n):
  now = int(input())
  x -= now
  cheap.append(now)
  ans += 1
ans += x // min(now)
print(ans)
Problem p03385 (python)

Fixed submission:
s = input()
cnt = []
for i in range(3):
  cnt.append(s[i])
cnt.sort()
if cnt == ['a','b','c']:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
cnt = []
for i in range(3):
  cnt.append(s[i])
cnt.sort()
if cnt = ['a','b','c']:
  print('Yes')
else:
  print('No')
Problem p03563 (python)

Fixed submission:
#18:09
r = int(input())
g = int(input())
print ( 2 * g - r )

Buggy submission (verdict: Runtime Error):
#18:09
r,g = map(int,input().split())
print ( 2 * g - r )
Problem p03575 (python)

Fixed submission:
n,m = map(int,input().split())
raw = []
ans = 0
for i in range(m):
  raw.append(list(map(lambda x:int(x)-1,input().split())))
for i in range(m):
  ab = [[] for _ in range(n)]
  for mi in range(m):
    if mi != i:
      try:
        here = raw[mi]
        ab[here[0]].append(here[1])
        ab[here[1]].append(here[0])
      except:
        print(ab,here,here[0],here[1])
  for ni in range(n):
    now = [ni]
    rest = [j for j in range(n)]
    for _ in range(50):
      nex = []
      for x in now:
        if x in rest:
          rest.remove(x)
        nex += ab[x]
      now = list(set(nex))
      if rest == []:
        break
    else:
      continue
    break
  else:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
raw = ['/' * (w+2)]
for hi in range(h):
  raw.append('/' + input() + '/')
raw += ['/' * (w+2)]
#print(raw)
for hi in range(h):
  ans = ''
  pre = raw[hi]
  now = raw[hi+1]
  pst = raw[hi+2]
  for wi in range(w):
    if now[wi+1] == '#':
      cnt = '#'
    else:
      cnt = 0
      can = pre[wi:wi+3] + now[wi:wi+3] + pst[wi:wi+3]
      for j in range(9):
        if can[j] == '#':
          cnt += 1
    ans += str(cnt)
  print(ans)
Problem p03597 (python)

Fixed submission:
#10:40
n = int(input())
a = int(input())
print ( n * n - a )

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

Fixed submission:
#ABC073
x,t = map(int,input().split())
print( max(0,x-t) )

Buggy submission (verdict: Runtime Error):
#ABC073
x,t = map(int,input())
print( max(0,x-t) )
Problem p03624 (python)

Fixed submission:
s = input()
t = set()
for i in range(len(s)):
  t.add(s[i])
o = list(t)
o.sort()
u = 'qwertyuiopasdfghjklzxcvbnm'
v = []
for i in range(len(u)):
  v.append(u[i])
v.sort()
now = 0
if len(o) == 26:
  print('None')
else:
  for i in range(26):
    if i >= len(t):
      print(v[i])
      break
    elif o[i] == v[i]:
      now += 1
    else:
      print(v[now])
      break

Buggy submission (verdict: Runtime Error):
s = input()
t = set()
for i in range(len(s)):
  t.add(s[i])
o = list(t)
o.sort()
u = 'qwertyuiopasdfghjklzxcvbnm'
v = []
for i in range(len(u)):
  v.append(u[i])
v.sort()
now = 0
if len(o) == 26:
  print('None')
else:
  for i in range(26):
    if o[i] == v[i]:
      now += 1
    else:
      print(v[now])
      break

Buggy submission (verdict: Runtime Error):
s = input()
t = set()
for i in range(len(s)):
  t.add(s[i])
o = list(t)
o.sort()
u = 'qwertyuiopasdfghjklzxcvbnm'
v = []
for i in range(len(u)):
  v.append(u[i])
v.sort()
now = 0
for i in range(26):
  if o[i] == v[i]:
    now += 1
  else:
    print(v[now])
    break
else:
  print('None')
Problem p03860 (python)

Fixed submission:
#09:23
a,b,c = input().split()
print('A'+b[0]+'C')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print('A'+b[0]+'C')
Problem p03997 (python)

Fixed submission:
#11:10
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)

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

Fixed submission:
#ABC043
l = list(map(int,input().split()))
l.sort()
if l == [5,5,7]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n,K = map(int,input().split())
use = [0,1,2,3,4,5,6,7,8,9]
useless = list(map(int,input().split()))
for i in range(K):
  use.remove(useless[i])
k = 10 - K
time = [0]
def suc(time):
  now = 0
  while True:
    if now >= len(time):
      time.append(0)
      break
    elif time[now] != k-1:
      time[now] += 1
      break
    else:
      time[now] = 0
      now += 1
  return time
#print(suc([0]))
#print(suc([1,1,1,1]))
#print(suc([1,0,1,1]))
while True:
  pay = 0
  for j in range(len(time)):
    pay += use[time[j]] * 10 ** j
  if pay >= n:
    print(pay)
    break
  time = suc(time)