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

Fixed submission:
from itertools import product
import numpy as np


def solve(string):
    n, *fp = map(int, string.split())
    f = np.asarray(fp[:10 * n]).reshape((n, 10))
    p = fp[10 * n:]
    ans = -n * 10**7
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        tmp = np.dot(f, np.asanyarray(o).T)
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))

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


def solve(string):
    n, *fp = map(int, string.split())
    # f = np.asarray(fp[:10 * n]).reshape((n, 10))
    f = fp[:10 * n]
    p = fp[10 * n:]
    ans = -n * 10**7
    """
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        # tmp = np.dot(f, np.asanyarray(o).T)
        tmp = [sum([for ]) for _f in f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)
    """
    int_f = [int("".join(map(str, f[10 * i:10 * (i + 1)])), 2) for i in range(n)]
    for o in range(1, 2**10):
        tmp = [sum(map(int, f"{o & _f:b}")) for _f in int_f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))

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


def solve(string):
    n, *fp = map(int, string.split())
    # f = np.asarray(fp[:10 * n]).reshape((n, 10))
    f = fp[:10 * n]
    p = fp[10 * n:]
    ans = -n * 10**7
    """
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        # tmp = np.dot(f, np.asanyarray(o).T)
        tmp = [sum([for ]) for _f in f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)
    """
    int_f = [int("".join(map(str, f[10 * i:10 * (i + 1)])), 2) for i in range(n)]
    for o in range(1, 2**10):
        tmp = [sum(map(int, f"{o & _f:b}")) for _f in int_f]
        print(tmp)
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
n,t=map(int,input().split())
l=[]
for i in range(n):
    l.append([j for j in map(int,input().split())])
    
a=float('inf')
for i in l:
    if i[1] <= t:a=i[0]
if a == float('inf'):
    a = 'TLE'
print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==1:print('Hello World')
else:
    a=int(input())
    b=int(inputt())
    print(a+b)
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<105:print(0)
elif n<3*5*9:print(1)
elif n<3*5*11:print(2)
else:print(3)
Problem p03293 (python)

Fixed submission:
import sys
s1=input ()
s2=input ()
for _ in range(len (s1)):
  if s1==s2:
    print ('Yes ')
    sys.exit ()
  s1=s1[-1]+s1[:-1]
print ('No ')

Buggy submission (verdict: Runtime Error):
import sys
s1=input ()
s2=input ()
for _ in range(len (s1)):
  if s1==s2:
    print ('Yes ')
    sys.exit ()
  s1=s1[-1]+s[:-1]
print ('No ')
Problem p03337 (python)

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

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

Fixed submission:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)

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

list=[0]*1000000000
for i in range(l):
    a=input()
    if list[a]==1:
        list[a]=0
    else:
        list[a]=1

print(list.count(1))
Problem p03657 (python)

Fixed submission:
f=lambda x:x%3==0
a,b=map(int,input().split())
print(['Impossible','Possible'][f(a)or f(b)or f(a+b)])

Buggy submission (verdict: Runtime Error):
f=lambda(x):x%3==0
a,b=map(int,input().split())
print(['Impossible','Possible'][f(a)or f(b)or f(a+b)])
Problem p03694 (python)

Fixed submission:
input();l=sorted(list(map(int,input().split())));print(l[-1]-l[0])

Buggy submission (verdict: Runtime Error):
input();l=list(map(int,input().split()).sort();print(l[-1]-l[0])
Problem p03695 (python)

Fixed submission:
import sys
def color(x):
  if x<400:return('灰')
  elif 399<x<800:return('茶')
  elif 799<x<1200:return('緑')
  elif 1199<x<1600:return('水')
  elif 1599<x<2000:return('青')
  elif 1999<x<2400:return('黄')
  elif 2399<x<2800:return('橙')
  elif 2799<x<3200:return('赤')
  else:return('*')
input()
l=list(map(int,input().split()))
l=[color(i) for i in l]
v=l.count('*')
c=v==len(l)
l=len(set(l))
if v==0:
  print(' '.join([str(l)]*2))
  sys.exit()
else:
  if c:v-=1
  else:l-=1
  print(l,end=' ')
print(l+v)

Buggy submission (verdict: Runtime Error):
import sys
def color(x):
  if x<400:return('灰')
  elif 399<x<800:return('茶')
  elif 799<x<1200:return('緑')
  elif 1199<x<1600:return('水')
  elif 1599<x<2000:return('青')
  elif 1999<x<2400:return('黄')
  elif 2399<x<2800:return('橙')
  elif 2799<x<3200:return('赤')
  else:return('*')
input()
l=list(map(int,input().split()))
l=[color(i) for i in l]
v=l.count('*')
l=len(set(l))
if v==0:
  print(' '.join([l]*2))
  sys.exit()
elif v>len(l):print(v,end=' ')
else: print(l,end=' ')
print(max(l+v,8))
Problem p03697 (python)

Fixed submission:
s=input();a=int(s[0])+int(s[-1]);print('error' if a>9 else a)

Buggy submission (verdict: Runtime Error):
s=input();a=s[0]+s[-1];print('error' if a>9 else a)
Problem p03699 (python)

Fixed submission:
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
k=0
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)
Problem p03711 (python)

Fixed submission:
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,7,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,6,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])
Problem p03777 (python)

Fixed submission:
a,b=input().split();print('DH'[a==b])

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

Fixed submission:
print('AARBCC'[int(input())<1200::2])

Buggy submission (verdict: Runtime Error):
print('AARBCC'[x<1200::2])
Problem p02747 (python)

Fixed submission:
s = input()
i = int(len(s) / 2)
if "hi" * i == s:
    print("Yes")

else:
    print("No")

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

if s[0] == "h" and s[1] == "i" and s[1] != s[2]:
    print("Yes")

else:
    print("No")
Problem p02748 (python)

Fixed submission:
A, B, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = [input().split() for i in range(m)]
ans = min(a) + min(b)

for i in range(m):
    ai = a[int(l[i][0]) - 1]
    bi = b[int(l[i][1]) - 1]
    ci = int(l[i][2])
    nc = ai + bi - ci
    ans = min(ans, nc)
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = [map(int, input().split()) for i in range(m)]
ans = min(a) + min(b)
for i in range(m):
    ai = a[l[i][0] - 1]
    bi = b[l[i][0] - 1]
    ci = c[l[i][0] - 1]
    nc = ai + bi - c
    ans = min(ans, nc)
print(nc)
Problem p02765 (python)

Fixed submission:
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

elif N < 10:
    print((R + 100 * (10 - N)))

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    print(int((R + 100(10 - N))))

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    printint((R + 100(10 - N)))
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
tmp = 2 * 10 ** 6
for i in range(n):
    if p[i] <= tmp:
        cnt += 1
        tmp = min(tmp, p[i])
print(cnt)

Buggy submission (verdict: Runtime Error):
 = int(input())
p = list(map(int, input().split()))
cnt = 0
tmp = 2 * 10 ** 6
for i in range(n):
    if p[i] <= tmp:
        cnt += 1
        tmp = min(tmp, p[i])
print(cnt)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
if k < a:
    print(str(a - k) + " " + str(b))
elif a <= k and k < a + b:
    print(str(0) + " " + str(b - k + a))
elif k >= a + b:
    print(str(0) + " " + str(0))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
ans_a = a - k
if ans_a < 0:
    ans_a = 0
    ans_b = b - abs(ans_a)
    if ans_b < 0 or k - a >= b:
        ans_b = 0
print(str(ans_a) + " " + str(ans_b))
Problem p02909 (python)

Fixed submission:
l = ["Sunny", "Cloudy", "Rainy"]
w = input()

if l.index(w) == 2:
    print("Sunny")

else:
    print(l[l.index(w) + 1])

Buggy submission (verdict: Runtime Error):
l = ["Sunny", "Cloudy", "Rainy"]
w = input()

if l.index(w) = 2:
    print("Sunny")

else:
    print(l[l.index(w) + 1])
Problem p02921 (python)

Fixed submission:
l = list(input())
m = list(input())
cnt = 0
for i in range(3):
    if l[i] == m[i]:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
l = input().split()
m = input().split()
cnt = 0
for i in range(3):
    if l[i] == m[i]:
        cnt += 1
print(cnt)
Problem p02958 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
    if i != p[i - 1]:
        l.append(i)
if len(l) <= 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
p = map(int, input().split())
l = []
for i in range(1, n + 1):
    if i != p[i - 1]:
        l.append(i)
if len(l) == 2:
    print("YES")
else:
    print("NO")
Problem p03030 (python)

Fixed submission:
N = int(input())
l = []
for i in range(N):
    s, p = input().split()
    l.append([s, int(p), i + 1])

l.sort(key = lambda x: (x[0], -x[1]))
for i in l:
    print(i[2])

Buggy submission (verdict: Runtime Error):
l = []
for i in range(N):
    s, p = input().split()
    l.append([s, int(p), i + 1])

l.sort(key = lambda x: (x[0], -x[1]))
for i in l:
    print(i[2])
Problem p03086 (python)

Fixed submission:
s = input()
l = []
cnt = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] =="C" or s[i] == "G" or s[i] == "T":
        cnt += 1
        #print(i, cnt)
        if i == len(s) - 1:
            l.append(cnt)
            
        
        
        
    elif i != "A" or i !="C" or i != "G" or i != "T":
        l.append(cnt)
        cnt = 0
        #print("y")
print(max(l))

Buggy submission (verdict: Runtime Error):
s = input()
l = []
cnt = 0
for i in s:
    if i == "A" or i =="C" or i == "G" or i == "T":
        cnt += 1
        
    else:
        l.append(cnt)
print(max(l))
Problem p03126 (python)

Fixed submission:
n, m = map(int,input().split())

m = [0] * 30
for i in range(n):
    a = list(map(int, input().split()))
    for j in range(1, len(a)):
        m[a[j] - 1] += 1

print(m.count(n))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]
m = []
for i in range(1, l[0][0] + 1):
    m.append(l[0][i])
for i in range(1, N):
    for j in m:
        
        if l[i][1:i[0] + 1].count(j) == 0:
            m.remove(j)
            
print(len(m))
Problem p03160 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
dp = [0] * n
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(1, n - 1):
    dp[i + 1] = min(dp[i - 1] + abs(h[i + 1] - h[i - 1]), dp[i] + abs(h[i + 1] - h[i]))
print(dp[n - 1])

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;

int N; 
long long h[100010];
long long dp[100010];
int main(){
    int N; cin >> N;
    for (int i = 0; i < N; ++i) cin >> h[i] ;
    for (int i = 0; i < N; ++i) dp[i] = INF;
    dp[0] = 0;
    for (int i = 0; i < N; ++i){
        chmin(dp[i + 1], dp[i] + abs(h[i + 1] - h[i]));
        chmin(dp[i + 2], dp[i] + abs(h[i + 2] - h[i]));
    }
cout << dp[N - 1] << endl;    
    
    
    
    
}
Problem p03238 (python)

Fixed submission:

n = int(input())
if n == 1:
    print("Hello World")
    exit()
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n == 1:
    print("Hello World")
    break
else:
    a = int(input())
    b = int(input())
    print(a + b)
Problem p03338 (python)

Fixed submission:
n = int(input())
s = input()
l = []

for i in range(1, len(s)):
    
    f = s[:i]
    b = s[i:]
    fset = list(set(s[:i]))
    bset = list(set(s[i:]))
    cnt = 0
   
    for j in fset:
        if bset.count(j) != 0:
            cnt += 1
    l.append(cnt)
   
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
l = []
for i in range(1, len(s) - 1):
    f = s[:i]
    b = s[i:]
    fset = list(set(s[:i]))
    bset = list(set(s[i:]))
    cnt = 0
    for j in fset:
        if bset.count(j) != 0:
            cnt += 1
    l.append(cnt)
print(max(l))
Problem p03369 (python)

Fixed submission:
S = input()
cnt = 0
for i in S:
    if i == "o":
        cnt += 1
print(cnt * 100 + 700)

Buggy submission (verdict: Runtime Error):
S = input()
cnt = 0
for i in s:
    if i == "o":
        cnt += 1
print(cnt * 100 + 700)

Buggy submission (verdict: Runtime Error):
S = input()
cnt = 0
for i in s:
    if i == "o":
    cnt += 1
print(cnt * 100 + 700)

Buggy submission (verdict: Runtime Error):
S = input()
cnt = 0
for i in s:
    if i == "o"
    cnt += 1
print(cnt * 100 + 700)
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
l = []
wa = 0
for i in range(1, N + 1):
    for j in str(i):
        wa += int(j)
        #print(wa)
    if wa >= A and wa <= B:
        l.append(i)
    wa = 0
print(sum(l))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = []
for i in range(1, N + 1):
    for j in range(str(i)):
        wa += int(j)
    if wa >= A and wa <= B:
        l.append(i)
print(sum)
Problem p03543 (python)

Fixed submission:
a = str(input())
if a[0] == a[1] == a[2] or a[1] == a[2] == a[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = str(input())
if a[0] = a[1] = a[2] or a[1] = a[2] = a[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = str(input())
if a = b = c or b = c = d:
    print("Yes")
else:
    print("No")
Problem p03555 (python)

Fixed submission:
l = input()
m = input()
if l[0] == m[2] and l[1] == m[1] and l[2] == m[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
l = input().split()
m = input().split()
if l[0] == m[2] and l[2] == m[2] and l[1] == l[0]:
    print("Yes")
else:
    print("No")
Problem p03624 (python)

Fixed submission:
s = set(input())
alp = "abcdefghijklmnopqrstuvwxyz"
alpl = [i for i in alp]
for i in s:
    if i in alp:
        alpl.remove(i)
if len(alpl) != 0:        
    print(sorted(alpl)[0])

else:
    print("None")

Buggy submission (verdict: Runtime Error):
s = set(input())
alp = "abcdefghijklmnopqrstuvwxyz"
alpl = [i for i in alp]
for i in s:
    if i in alp:
        alpl.remove(i)
        
print(sorted(alpl)[0])
Problem p03644 (python)

Fixed submission:
n = int(input())
if n == 1:
    print(1)
elif n >= 2 and n < 4:
    print(2)
elif n >= 4 and n < 8:
    print(4)
elif n >= 8 and n < 16:
    print(8)
elif n >= 16 and n < 32:
    print(16)
elif n >= 32 and n < 64:
    print(32)
elif n >= 64:
    print(64)

Buggy submission (verdict: Runtime Error):
n = int(input())
l =[]
for i in range(1,n + 1):
    cnt = 0
    while i % 2 == 0 and i > 1:
        cnt += 1
        i = i / 2
        
            
    if cnt >= 1:
        l.append(int(i * 2 ** cnt))
print(max(l))
Problem p03671 (python)

Fixed submission:
l= list(map(int, input().split()))
ans = sum(l) - max(l)
print(ans)

Buggy submission (verdict: Runtime Error):
l= map(int, input().split())
ans = sum(l) - max(l)
print(ans)
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
now = 0
cnt = 0
for i in range(n):
    #print(now)
    now = a[now] - 1
    cnt += 1
    if now == 1:
        
        print(cnt)
        
        exit()
print("-1")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
now = a[0]
cnt = 0
for i in range(n):
    cnt += 1
    now = a[now - 1]
    
    if a[now] == 2:
        
        print(cnt + 1)
        
        exit()
print("-1")
Problem p03699 (python)

Fixed submission:
n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
    if i % 10 == 0:
        cnt += 1
        
if cnt == n:
    print(0)
    exit()
    
if wa % 10 != 0:
    print(wa)
else:
    l.sort()
    for i in l:
        if i % 10 != 0:
            print(wa - i)
            break

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
    if i % 10:
        cnt += 10
if cnt == n:
    print(0)
    exit()
    
if wa % 10 != 0:
    print(wa)
else:
    l.sort()
    for i in l:
        if i % 10 != 0:
            ex = i
            break
    
    print(wa - ex)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
    if i % 10:
        cnt += 10
if cnt == n:
    print(0)
    exit()
    
if wa % 10:
    print(wa)
else:
    l.sort()
    for i in l:
        if i % 10 != 0:
            ex = i
            break
    
    print(wa - ex)
Problem p03711 (python)

Fixed submission:
x, y = map(int, input().split())
l = [1, 3, 5, 7, 8, 10, 12]
m = [4, 6, 9, 11]
n = [2]
if l.count(x) == l.count(y) != 0 or m.count(x) == m.count(y) != 0 or x == y == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
l = [1, 3, 5, 7, 8, 10, ,12]
m = [4, 6, 9, 11]
n = [2]
if l.count(x) == l.count(y) != 0 or m.count(x) == m.count(y) != 0 or x == y == 2:
    print("Yes")
else:
    print("No")
Problem p03844 (python)

Fixed submission:
a, op, b = input().split()
if op == "+":
  print(int(a) + int(b))
else:
  print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a, op, b = input().split()
if op = "+":
  print(int(a) + int(b))
else:
  print(int(a) - int(b))
Problem p03860 (python)

Fixed submission:
a, b, c = map(str, input().split())
print(a[0] + b[0] + c[0])

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

Fixed submission:
l = list(map(int, input().split()))
p = max(l)
s = min(l)
wa =sum(l)
m = wa - p - s
if m + s == p:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = map(int, input().split())
m = max(l)
n = l.pop(m)
wa = 0
for i in n:
    wa += i
if wa == m:
    print("Yes")
else:
    print("No")
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if k < n :
  print(k * x + (n - k) * y)
else:
  print(n * x)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if k < n :
  print(k * x + (n - k) * y)
else:
  primt(n * x)
Problem p04030 (python)

Fixed submission:
s = input()
l =[]
for i in range(len(s)):
    if s[i] == "0":
        l.append("0")
    elif s[i] == "1":
        l.append("1")
    elif s[i] =="B":
        if len(l) == 0:
           pass
        else:
           del l[-1]
print("".join(l))

Buggy submission (verdict: Runtime Error):
s = input()
l =[]
for i in range(len(s)):
    if s[i] == "0":
        l.append("0")
    elif s[i] == "1":
        l.append("1")
    elif s[i] =="B":
        if len(l) == 0:
           pass
        else:
           del l[i - 1]
print("".join(l))
Problem p02658 (python)

Fixed submission:
import sys
 
N = input()
nums = list(map(int, input().split()))
res = 1

if 0 in nums:
  res = 0
else:
  for i in nums:
    res *= i
    if res > 10 ** 18:
      res = -1
      break
print(res)

Buggy submission (verdict: Runtime Error):
N = input()
nums = input().split()
res = int(nums.pop(0))

if 0 in nums:
  print('0')
  return

for i in nums:
  res *= int(i)

print(res)
Problem p02817 (python)

Fixed submission:
s=input().split()
print(s[1]+s[0])

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
print(t+s)
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
a = [0] * n
if n==2:
    print(b[0]*2)
else:
    #c = d = 0
    a[0] = b[0]
    for i in range(n-1,-1,-1):
        if i == n-1:
            a[i] = b[i-1]
        elif i == 0:
            pass
            #a[0] = min(b[0],b[1])
        else:
            a[i] = min(b[i-1],b[i])
    print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
a = [0] * n
if n==2:
    print(b[0]*2)
else:
    #c = d = 0
    a[0] = b[0]
    for i in range(n-1,-1,-1):
        if i == n-1:
            a[i] = b[i-1]
        elif i == 0:
            #a[0] = min(b[0],b[1])
        else:
            a[i] = min(b[i-1],b[i])
    print(sum(a))
Problem p02994 (python)

Fixed submission:
N,L = map(int,input().split())
if L > 0:
    k = N*(L-1) + (N * (N+1))//2 - L
    print(k)
elif L == 0:
    print( (N-1) * N //2)
else: 
    if L+N-1 >=0:
        k = N*(L-1) + (N * (N+1))//2
        print(k)
    else:
        k = N*(L-1) + (N * (N+1))//2 - (L+N-1)
        print(k)

Buggy submission (verdict: Runtime Error):
if L > 0:
    k = N*(L-1) + (N * (N+1))//2 - L
    print(k)
elif L == 0:
    print( (N-1) * N //2)
else: 
    if L+N-1 >=0:
        k = N*(L-1) + (N * (N+1))//2
        print(k)
    else:
        k = N*(L-1) + (N * (N+1))//2 - (L+N-1)
        print(k)
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
l = list(map(int,input().split()))
#print(l)
d = preD = 0
i = 0
for i in range(N):
    d = preD + l[i]
    preD = d
    #print(i+1,d)
    if d == X:
        print(i+2)
        break
    elif d > X:
        print(i+1)
        break
else:
    print(N+1)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
l = list(map(int,input().split()))
d = preD = 0
i = 0
while d <= X:
    d = preD + l[i]
    i += 1
    preD = d
print(i)