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

Fixed submission:
import numpy as np
H,W = map(int,input().split())
S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.'
D = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)
for i in range(H):# 上下
  U[i] = (U[i-1] + 1) * S[i]
  D[-i-1] = (D[-i] + 1) * S[-i-1]
for i in range(W):# 左右
  L[:,i] = (L[:,i-1] + 1) * S[:,i]
  R[:,-i-1] = (R[:,-i] + 1) * S[:,-i-1]
print(np.max(U+D+L+R)-3)

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W = map(int,input().split())
S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.'
D = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)
for i in range(H):# 上下
  U[i] = (U[i-1] + 1) * S[i]
  D[-i-1] = (D[-i] + 1) * S[-i-1]
for i in range(W):# 左右
  L[:,i] = (L[:,i-1] + 1) * S[:,i]
  R[:,-i-1] = (R[:,-i] + 1) * S[:,-i-1]
print(np.max(U+D+L+R)-3)

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W = map(int,input().split())
S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.'
D = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)
for i in range(H):# 上下
  U[i] = (U[i-1] + 1) * S[i]
  D[-i-1] = (D[-i] + 1) * S[-i-1]
for i in range(W):# 左右
  L[:,i] = (L[:,i-1] + 1) * S[:,i]
  '''print(L[:,i-1] + 1)
  print(S[:,i])
  print(L[:,i])'''
  R[:,-i-1] = (R[:,-i] + 1) * S[:,-i-1]
print(np.max(U+D+L+R)-3)

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

def solve():
    H, W = list(map(int, sys.stdin.readline().split()))
    grid = []
    for _ in range(H):
        grid.append(list(input()))
    grid = (np.array(grid) == ".")*1  # ランプが置ける:1, 障害物:0

    #print(grid)

    L = np.zeros((H,W), dtype=int)  # 左方向に照らせるマスの数
    R = np.zeros((H,W), dtype=int)  # 右方向に照らせるマスの数
    U = np.zeros((H,W), dtype=int)  # 上方向に照らせるマスの数
    D = np.zeros((H,W), dtype=int)  # 下方向に照らせるマスの数

    # 左方向に照らせるマスの数のDPを埋める
    for i in range(W):
        if i == 0:
            L[:, i] = grid[:, i]
        else:
            L[:, i] = (L[:, i-1] + 1) * grid[:, i]

    # 右方向に照らせるマスの数のDPを埋める
    for i in range(W-1, -1, -1):
        if i == W-1:
            R[:, i] = grid[:, i]
        else:
            R[:, i] = (R[:, i+1] + 1) * grid[:, i]

    # 上方向に照らせるマスの数のDPを埋める
    for i in range(H):
        if i == 0:
            U[i] = grid[i]
        else:
            U[i] = (U[i-1] + 1) * grid[i]

    # 下の方向に照らせるマスの数のDPを埋める
    for i in range(H-1, -1, -1):
        if i == H-1:
            D[i] = grid[i]
        else:
            D[i] = (D[i+1] + 1) * grid[i]

    # 上下左右すべてのDPを埋めた。
    # よって、i行j列目に明かりを設置したとき、上下左右に照らせるマスの数を格納した ans_grid は、
    ans_grid = L + R + U + D - 3
    ans = np.max(ans_grid)
    print(ans)


if __name__ == "__main__":
    solve()
Problem p03030 (python)

Fixed submission:
N=int(input())
SP=[]
for i in range(N):
  S,P=input().split()
  SP.append([S,int(P),i+1])
  
l=sorted(SP,key = lambda SP : (SP[0],-SP[1]))

for i in l:
  print(i[2])

Buggy submission (verdict: Runtime Error):
N=int(input())
SP=[]
for i in range(N):
  S,P=input()
  SP.append([S,int(P),i+1])
  
l=sorted(SP,key = lamda SP : (SP[0],-SP[1]))

for i in l:
  print(SP[2])
Problem p03068 (python)

Fixed submission:
input()
S=input()
k=int(input())
for s in S:print(s if s==S[k-1] else "*",end="")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
for i in range(N):
  if S[K-1]==S[i]:
    S[i]='*'
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
for i in S:
  if S[K-1]==S[i]:
    S[i]='*'
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
for i in S:
  if S[K]==S[i]:
    S[i]='*'
print(S)
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w=map(int,input().split())
ptint((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w=map(int,input().split())
ptint((H-h)*((W-w))
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int(),input().split())
print((A*B)//2)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int(),input().split())
print(A*B//2)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int(),input().split())
print(A*B/2)

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

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

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

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

Buggy submission (verdict: Runtime Error):
a,b=int(input())
print(a*b/2)
Problem p03161 (python)

Fixed submission:
N,K=map(int,input().split())
h=[int(i) for i in input().split()]
f_inf=float('inf')
dp=[f_inf]*(N+10)
dp[0]=0
for i in range(1,N):
  for j in range(1,K+1):
    if i-j>=0:
      dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
H=list(map(int,input().split()))
INF=1000000000
dp=[INF]*(N+1)
dp[0]=0
for i in range(1,N):
  if i==1:
    dp[i]=dp[i-1]+abs(H[i]-H[i-1])
  else:
    dp[i]=min(dp[i-2]+abs(H[i-2]-H[i]),dp[i-1]+abs(H[i-1]-H[i]))
print(dp[N-1])
Problem p03163 (python)

Fixed submission:
N,W=map(int,input().split())
L = [list(map(int, input().split())) for i in range(N)]
dp = [[0 for j in range(110000)] for i in range(110)]
for i in range(1,N+1):
  for j in range(W+1):
    dp[i][j]=dp[i-1][j]
    if j-L[i-1][0]>=0:
      dp[i][j]=max(dp[i][j],dp[i-1][j-L[i-1][0]]+L[i-1][1])
ans=dp[N][W]
print(ans)

Buggy submission (verdict: Runtime Error):
n,W=map(int,input().split())
wv=[[int(j) for j in input().split()] for i in range(n)]
dp=[[0]*110 for i in range(110000)]

for i in range(1,n+1):
  for j in range(W+1):
    dp[i][j]=dp[i-1][j]
    if j-wv[i-1][0]>=0:
      dp[i][j]=max(dp[i][j],
                   dp[i-1][j-wv[i-1][0]]+wv[i-1][1])
      
print(dp[n][W])
Problem p03210 (python)

Fixed submission:
x=input()
if x in "753":
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
X=int(input())
if (X==3 || X==5 ||X==7):
  print('YES')
else:
  print('NO')
Problem p03282 (python)

Fixed submission:
s = str(input())
k = int(input())

for i in range(min(len(s),k)):
#「Sの長さ」と「K」の少ない方の回数分ループを回す
    if s[i] != '1':#Kまで１が続かなかったら
        print(s[i])#最初に出てきた１以外の数が出力される
        exit()#ループを抜けて終了

print('1')#Kまで１が続けば、１が出力される

Buggy submission (verdict: Runtime Error):
S=input()
K=int(input())
cnt=0
i=0
while S[i]=='1':
  cnt+=1
  i+=1
if cnt>K:
  ans=1
else:
  ans=S[cnt]
print(ans)
Problem p03337 (python)

Fixed submission:
A,B=map(int,input().split())
X=A*B
Y=A-B
Z=A+B
print(max(X,Y,Z))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
X=A*B
Y=A-B
X=A+B
print(max(X,Y,Z))
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(b-c)<=d and abs(a-b)<=d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
else if abs(b-c)<=d and abs(a-b)<=d:
  print('Yes')
else:
  print('No')
Problem p03385 (python)

Fixed submission:
L=set(input())
if len(L)==3:
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
L=[cha[i] for i in int().split()]
sorted.L
if L=='abc':
  print('Yes')
else :
  print('No')
Problem p03423 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
N+=2
ans=N//3
ans-=
print(ans)
Problem p03424 (python)

Fixed submission:
input()
print("Four" if "Y" in input() else "Three")

Buggy submission (verdict: Runtime Error):
N=int(input())
Flag=False
for i in range(N):
  C=input()
  if C=='Y':
    Flag=True
    
print('Four' if Flag else 'Three')
Problem p03436 (python)

Fixed submission:
from collections import deque


def bfs():
    d = [[float("inf")] * w for i in range(h)]

    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    d[sx][sy] = 0

    while que:
        p = que.popleft()
        if p[0] == gx and p[1] == gy:
            break
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]

            if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] != "#" and d[nx][ny] == float("inf"):
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1

    return d[gx][gy]


h, w = map(int, input().split())
maze = [list(input()) for i in range(h)]
sx, sy = 0, 0
gx, gy = h - 1, w - 1

# 白いマスを数える
white = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == ".":
            white += 1

res = bfs()
if 0 < res < float("inf"):
    # 白いマスの数から最短経路でかかるコスト分を引く
    # ゴールを黒いマスに変えることはできないためその分も引く
    print(white - res - 1)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
def MI(): return map(int, input().split())
from collections import deque
H,W=MI()
#Map=[[]*W for _ in range(H)]
Map=[]
white=0
for _ in range(H):
  Map.append(list(input()))
def bfs():
  dx=[-1,0,1,0]
  dy=[0,-1,0,1]
  INF=float('inf')
  dist=[[INF]*W for _ in range(H)]
  dist[0][0]=0
  que=deque()
  que.append((0,(0,0)))

  while que:
    d,(x,y) =que.popleft()
    for i in range(4):
      nx=x+dx[i]
      ny=y+dy[i]
      if 0<=nx<H and 0<=ny<W:
        if Map[nx][ny]!='#':
          if dist[nx][ny]==INF:
            dist[nx][ny]=d+1
            que.append((d+1,(nx,ny)))
  return dist
res=bfs()  
for i in range(H):
  for j in range(W):
    if Map[i][j]=='.':
      white+=1
ans=white-res[H-1][W-1]-1
if 0<ans<INF:
  print(ans)
else:
  print(-1)
Problem p03455 (python)

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

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

Fixed submission:
S = input()
print(S.replace("2017/", "2018/", 1))

Buggy submission (verdict: Runtime Error):
S=input()
S[3]='7'
print(S)
Problem p03493 (python)

Fixed submission:
l=input()
c=0
for i in l:
  if i=='1':
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
l=[map(int,input().split(''))]
c=0
for i in l:
  if i=='1':
    c+=1
print(c)
Problem p03494 (python)

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

ans=10**9

for i in A:
  p=0
  while i%2 ==0:
    i/=2
    p+=1
  if p<ans:
    ans=p
    
print(ans)

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

ans=10**9

for i in A:
  p=0
  while i%2 ==0:
    i=/2
    p+=1
  if p<ans:
    ans=p
    
print(ans)

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

ans=10**9

for i in A:
  p=0
  while i % 2 ==0:
    i=/2
    p+=1
  if p<ans:
    ans=p
    
print(ans)
Problem p03543 (python)

Fixed submission:
a,b,c,d=input()
if a==b and b==c:
  print('Yes')
elif b==c and c==d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=input()
if a==b && b==c:
  print('Yes')
elif b==c && c==d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=input()
if a==b && b==c:
  print('Yes')
else if b==c && c==d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=input()
if a==b && b==c:
  print('Yes')
elif b==c && c==d:
  print('Yes')
else:
  print('No')
Problem p03636 (python)

Fixed submission:
s=input()
print(s[0]+str(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=input()
print(s[0]+len(s)-2+s[-1])
Problem p03673 (python)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
answer = A[1::2][::-1]+A[::2]
if n%2==1:
    answer=answer[::-1]
print(*answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2]+*A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])
Problem p03760 (python)

Fixed submission:
o=list(input())
e=list(input())+[""]
for x,y in zip(o,e):print(x+y,end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())+[""]
n=max(len(o),len(e))
for i in range(n):
  print(o[i],end="")
  print(e[i],end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())+[""]
n=max(len(o),len(e))
for i in range(n):
  print(o[i]+e[i],end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())
n=max(len(o),len(e))
for i in range(n):
  print(o[i]+e[i],end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())
n=max(len(o),len(e))
for i in range(n):
  print(o[i],end="")
  print(e[i],end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())

for i in range(len(o)+1):
  print(o[i],end="")
  print(e[i],end="")

Buggy submission (verdict: Runtime Error):
o=list(input())
e=list(input())

for i in range(len(o)):
  print(o[i],end="")
  print(e[i],end="")

Buggy submission (verdict: Runtime Error):
O,E=map(int,input().split())
for i in range(O.size()):
  print(O[i]+E[i],end='')
Problem p03777 (python)

Fixed submission:
a,_,b=input()
print("DH"[a==b])

Buggy submission (verdict: Runtime Error):
a,_,b=map(int,input().split())
print('DH'[a==b])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print('DH'[a==b])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print('HD'[a==b])
Problem p03779 (python)

Fixed submission:
x=int(input())
for i in range(1,10**5):
    if x<=(i*(i+1))//2:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
X=int(input())
if X==1:
  print(1)
if X==2:
  print(2)
for i in range(2,X):
  if i*i+i>=2*X:
    ans=i
    break
  print(ans)
Problem p03814 (python)

Fixed submission:
s=list(input())
a=200000
z=0

for i in range(len(s)):
  if s[i]=='A'and a>i:
    a=i
  if s[i]=='Z'and z<i:
    z=i
print(z-a+1)

Buggy submission (verdict: Runtime Error):
S=input()
N=len(S)
for i in range(N):
  if S[i]=='A':
    A=i
    break
for i in range(N,0):
  if S[i]=='Z':
    Z=i
    break
ans=Z-A+1

print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input().split())

for i in range(len(s)):
  if i=='A':
    a=i
  if i=='Z':
    z=i
print(z-a+1)
Problem p03827 (python)

Fixed submission:
N=int(input())
S=input()
ans=0
cnt=0
for i in range(N):
  if S[i]=='I':
    cnt+=1
    ans=max(cnt,ans)
  else:
    cnt-=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
ans=0
cnt=0
for i in range(N):
  if S[i]='I':
    cnt+=1
    ans=max(cnt,ans)
  else:
    cnt-=1
print(ans)
Problem p03828 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    l = [0 for _ in range(N)]
    is_prime = [True for _ in range(N+1)]
    is_prime[0],is_prime[1] = False,False
    INF = 10**9+7
    
    for i in range(N+1):
        if is_prime[i]:
            for j in range(2*i,N+1,i):
                is_prime[j] = False

    fa = [0 for _ in range(N+1)]                
    for x in range(1,N+1):
        for i in range(1,x+1):
            if (is_prime[i] and x%i == 0):
                while x%i == 0:
                    fa[i] += 1
                    x //= i
 
    ans = 1
    for i in range(N+1):
        ans *= fa[i]+1
        ans %= INF
        
    print(ans)
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def memoize(f): #メモ化関数
  table = {}
  def func(*args):
    if not args in table:
      table[args] = func(*args)
    return table[args]
  return func
  
@memoize
def fac(x):
  if x==0:
    return 1
  else:
    return x*fac(x-1)

N=int(input())

def divisor(n): #nの約数を全て求める
    i = 1
    while i * i < n:
        if n%i == 0:
            table.append(i)
            
        i += 1
    table = list(set(table))
    return table

def make_divisors(n):
    cnt=0
    i=1
    while i * i < n:
      if n%i == 0:
        cnt+=2            
        i += 1
    if i*i==n:
      cnt+=1
    return cnt
ans1=fac(N)
ans2=make_divisors(ans1)%(10**9+7)
print(ans2)

Buggy submission (verdict: Runtime Error):
@memoize
def fac(x):
  if x==0:
    return 1
  else:
    return x*fac(x-1)

N=int(input())
ans=fac(N)%(10**9+7)
print(ans)
Problem p03844 (python)

Fixed submission:
print(eval(input()))

Buggy submission (verdict: Runtime Error):
print(eval(input())

Buggy submission (verdict: Runtime Error):
print(int(eval(input()))

Buggy submission (verdict: Runtime Error):
print(eval(input())

Buggy submission (verdict: Runtime Error):
A,B,C=map(str,input().split())
ans=eval('A' 'B' 'C')
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C=map(str,input().split())
ans=eval(A B C)
print(ans)
Problem p03845 (python)

Fixed submission:
N=int(input())
T=list(map(int,input().split()))
T_ALL=sum(T)
M=int(input())

for i in range(M):
  P,X=map(int,input().split())
  ans=T_ALL+X-T[P-1]
  print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T=list(map(int,input().split()))
TA=sum(T)
M=int(input())
for i in range(M):
  P,X=map(int,input().split())
  ans=TA+X-T[p-1]
  print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T=list(map(int,input().split()))
TA=sum(T)
M=int(input())
for i in range(M):
  P,X=map(int,input().split())
  ans=TA+X+T[p-1]
  print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T=list(map(int,input().split()))
M=int(input())
for i in range(M):
  P[i],X[i]=int(input().split())
  
T_ALL=sum(T)
  
for i in range():
  ans=T_ALL+X[P[i]]-T[i]
  print(ans)
Problem p03860 (python)

Fixed submission:
print("A"+input()[8]+"C")

Buggy submission (verdict: Runtime Error):
A,B,C=map(input().split())
print(A[0]+B[0]+C[0])
Problem p03862 (python)

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

cnt=0
pre=0

for i in range(N):
  dif=max(A[i]+pre-x,0)
  cnt+=dif
  A[i]-=dif
  pre=A[i]
  
print(cnt)

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

cnt=0
pre=0

for i in range(N):
  dif=max(A[i]+pre-x,0)
  cnt+=dif
  arr[i]-=dif
  pre=arr[i]
  
print(cnt)
Problem p03944 (python)

Fixed submission:
w,h,n=map(int,input().split())
a1,a2,a3,a4=0,w,0,h
for i in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        a1=max(a1,x)
    elif a==2:
        a2=min(a2,x)
    elif a==3:
        a3=max(a3,y)
    else:
        a4=min(a4,y)
print(max(a2-a1,0)*max(a4-a3,0))

Buggy submission (verdict: Runtime Error):
W,H,N=map(int,input().split())
x=[0]*N
y=[0]*N
a=[0]*N
minX=0
maxX=W
minY=0
maxY=H
for i in range(N):
  x[i],y[i],a[i]=map(int,input().split())
  if a[i]==1:
    minX=max(minX,x[i])
  if a[i]==2:
    maxX=min(maxX,x[i]) 
  if a[i]==3:
    minY=max(minY,y[i])
  if a[i]==4:
    maxY=min(maxY,y[i]) 

ans=(maxX-minX)*(maxY-minY)
if maxX<minX or maxY<minY:
  ans=0
print(max(ans)
Problem p03945 (python)

Fixed submission:
S=input()
cnt=0
for i in range(len(S)-1):
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
S=input()
for i in range(len(S)-1):
  cnt=0
  if S[i]!=S[i+1]:
    cnt+=1
print(cnt)
Problem p03997 (python)

Fixed submission:
A=[0]*3
for i in range(3):
  A[i]=int(input())
#print(A)
ans=int((A[0]+A[1])*A[2]/2)
print(ans)

Buggy submission (verdict: Runtime Error):
for i in range(3):
  A[i]=int(input())
#print(A)
ans=(A[0]+A[1])*A[2]/2
print(ans)
Problem p04011 (python)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
cost=N*X-(X-Y)*(max(N-K,0))
print(cost)

Buggy submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split())
cost=K*X+(N-K)*Y
print(cost)
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[]
for i range(n):
  s.append(input())
s.sort()
ans=''
for x in s:
  ans+=x
print(ans)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
for i range(n):
  s=input()
s=s.sort()
print(*s,sep='')

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
s=[]
for i in range(N):
  s.append(i)
s.sort()
ans = ''
for x in s:
    ans += x
print(ans)
Problem p02658 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=1
if 0 in a:
  print(0)
else:
  for i in range(n):
    ans=ans*a[i]
    if ans>10**18:
      print(-1)
      break
  else:
    print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
tempb=float(b)*100
tempa=int(a)
print(int(tempa*tempb/100))

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
tempb=float(eval(b)*100)
tempa=int(eval(a))
print(int(tempa*tempb/100))
Problem p02683 (python)

Fixed submission:
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*n
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
if ans==999999999999999999:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*m
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
if ans==999999999999999999:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*m
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
print(ans)