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

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
pre=0
ans = 0
while True:
  for i in range(N):
    if(A[i]/2)%1==0:
      pre+=1
  if pre == N:
      ans+=1
      A=[x/2 for x in A]
      pre =0
  else:
      print(ans)
      exit()

Buggy submission (verdict: Runtime Error):
import numpy as num
N = int(input())
A = list(map(int,input().split()))
ary = num.array(A)
b = len(A)
S=1
ans = 0
while True:
  for i in range(b):
    S*=A[i]
  if S %2 == 0:
    ans+=1
    ary = ary/2
    ary=A
    S=1
  else:
    print(ans)
    exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
S=int(input().split())
i=0
while S%2!==0:
i+=1
print(i)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=int(input().split())
i=0
while S%2!==0
i+=1
print(i)
Problem p03556 (python)

Fixed submission:
N = int(input())
print(int(N**0.5)**2)

Buggy submission (verdict: Runtime Error):
X = int(input())
  print(int(X**0.5)**2)

Buggy submission (verdict: Runtime Error):
X=int(input())
  print(int(X**0.5)**2)

Buggy submission (verdict: Runtime Error):
X=int(input())
  print (int(X**0.5)**2)

Buggy submission (verdict: Runtime Error):
X=int(input())
  print (int(X**0.5))
Problem p03624 (python)

Fixed submission:
N=list(input())
s=set(N)
ans=''.join(sorted(s))
all=[chr(i) for i in range(97,97+26)]
if ans=='abcdefghijklmnopqrstuvwxyz':
  print('None')
  exit()
for i in range(len(ans)):
  if ans[i]!=all[i]:
    print(all[i])
    exit()
  elif i==len(ans)-1 :
    print(all[len(ans)])
    exit()

Buggy submission (verdict: Runtime Error):
N=list(input())
s=set(N)
ans=''.join(sorted(s))
if len(ans)==1 and ans[0]=='a':
  print('b')
  exit()
all=[chr(i) for i in range(97,97+26)]
if ans==all:
  print('None')
  exit()
for i in range(len(ans)):
  if ans[i]!=all[i]:
    print(all[i])
    exit()
  else:
    print(all[len(ans)])
    exit()

Buggy submission (verdict: Runtime Error):
N=list(input())
s=set(N)
ans=''.join(sorted(s))
all=[chr(i) for i in range(97,97+26)]
for i in range(27):
  if ans[i]!=all[i]:
    print(all[i])
    exit()
print('None')
Problem p03720 (python)

Fixed submission:
a,b=map(int,input().split())
L=[]
for i in range(1,b+1):
    L +=[int(x) for x in input().split()]
for j in range(1,a+1):
      print(L.count(j))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
L=input()
for i in range(b):
  L.append(input())
  
  for j in range(b):
    print(L.count(L))
Problem p03738 (python)

Fixed submission:
a=int(input())
b=int(input())
if a>b:
  print('GREATER')
elif a==b:
  print('EQUAL')
else:
  print('LESS')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
  print('GREATER')
elif a=b:
  print('EQUAL')
else:
  print('LESS')
Problem p03760 (python)

Fixed submission:
N=input()
M=input()
N=list(str(N))
M=list(str(M))
ans=[]
if len(N)>len(M):
  for i in range(len(N)-1):
    ans.append(N[i])
    ans.append(M[i])
  ans.append(N[-1])
else:
  for i in range(len(N)):
    ans.append(N[i])
    ans.append(M[i])
print("".join(ans))

Buggy submission (verdict: Runtime Error):
N=input()
M=input()
N=list(str(N))
M=list(str(M))
ans=[]
for i in range(len(N)):
  ans.append(N[i])
  ans.append(M[i])
print("".join(ans))
Problem p03962 (python)

Fixed submission:
s=list(input().split())
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
s=input()
b=input()
n=input()
list=[s,b,n]
print(len(set(list)))
Problem p03971 (python)

Fixed submission:
N,h,u=map(int,input().split())
S = input()
kaigai=0
goukei=0
for i in range(0,N):
  if S[i]=='a' and goukei<h+u:
    print("Yes")
    goukei+=1
  elif S[i]=='b'and goukei<h+u and kaigai<u:
    print("Yes")
    goukei+=1
    kaigai+=1
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
S=list(map(input().split()))
sin=0
cos=0
for i in range(S)
	if S.pop(i)='a'or'b':
    sin+=1
    if S.pop(i)='b':
    cos+=1
    print("Yes" if S.pop(i)='a' and sin<A+B:
"Yes" elif S.pop(i)='b' and B<=cos and sin<A+B:
    else "No")

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
S=list(map(input().split()))
sin=0
cos=0
K=list.count("a")
G=list.count("b")
for i in range(S)
	if S.pop(i)='a'or'b':
    sin+=1
    if S.pop(i)='b':
    cos+=1
    print("Yes" if S.pop(i)='a' and sin<K+G:
"Yes" elif s.pop(i)='b' and G<=cos and sin<K+G:
    else "No")
Problem p04033 (python)

Fixed submission:
a,b=map(int,input().split())
if 0<a:
  print("Positive")
  exit()
else:
  if b<0:
    S=(b-a+1)%2
    if S==1:
      print("Negative")
    else:
      print("Positive")
  else:
    print("Zero")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if 0<a:
  print("Positive")
  exit()
W=list(range(a,b+1))
ne=0
if 0 in W:
  print("Zero")
  exit()
else:
  for i in range(len(W)):
    if W[i]<0:
      ne+=1
  if ne%2==0:
    print("Positive")
  else:
    print("Negative")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
W=list(range(a,b+1))
ne=0
if 0 in W:
  print("Zero")
  exit()
else:
  for i in range(len(W)):
    if W[i]<0:
      ne+=1
  if ne%2==0:
    print("Positive")
  else:
    print("Negative")
Problem p04044 (python)

Fixed submission:
a,b = map(int,input().split())
L=[]
for i in range(a):
    L.append(input())
    
    K=sorted(L)
print(''.join(K))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
L=[]
for i in range(b):
    L.append(input())
    
    K=sorted(L)
print(''.join(K))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
L=[list(map(input().split())) for i in range(b)]
 print(L.sort())
Problem p03644 (python)

Fixed submission:
import sys

N = int(sys.stdin.readline().rstrip())

n = 1

while n <= N:
  n = n * 2

print(int(n/2))

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline().rstrip())

n = 1

while n <= N
  n = n * 2

print(n/2)
Problem p02706 (python)

Fixed submission:
n,m = input().split()
add = 0
n = int(n)
m = int(m)
lst = list(map(int,input().split()))
for i in lst:
  add += i
if add>n :
  print(-1)
elif(add == n):
  print(0)
else:
  print(n-add)

Buggy submission (verdict: Runtime Error):
n,m = input().split()
add = 0
n = int(n)
m = int(m)
lst = list(map(int,input().split()))
for i in lst:
  add += i
if add>n :
  print(-1)
elif(add = n):
  print(0)
else:
  print(n-add)

Buggy submission (verdict: Runtime Error):
n,m = input().split()
add = 0
n = int(n)

m = int(m)

for i in range(m):
  lst = list(map(int,input().split()))
for i in lst:
  add += i
if add>n :
  print(-1)
elif(add = n):
  print(0)
else:
  print(n-add)
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
b = int(input())
print(a[b])
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
def nhan(A):
    multi = 1
    for i in A:
        multi *= i
        if multi > 10**18: return -1
    return multi
print(nhan(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = str(input())
lst =[]
for i in arr.split():
    lst.append(i)
multi = 1
lst = lst.sort()
temp = pow(10,18)
for i in lst:
    if int(i) > temp:
        print(-1)
        exit(0)
    else: multi *= int(i)
print(multi)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = str(input())
lst =[]
for i in arr.split():
    lst.append(i)
multi = 1
for i in lst:
    if i > pow(10,18):
        print(-1)
        exit(0)
    else: multi *= int(i)
print(multi)
Problem p03166 (python)

Fixed submission:
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 01/08/2020

from sys import stdin, stdout
import sys
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007
sys.setrecursionlimit(100000)
n, m = iia()
dp = [-1] * (n + 1)
d = {}
for i in range(m):
    a, b = iia()
    d.setdefault(a, []).append(b)

def dfs(cur):
    if dp[cur] != -1:
        return dp[cur]
    t = 0
    for i in d.get(cur, []):
        t = max(1 + dfs(i), t)
    dp[cur] = t
    return dp[cur]

res = 0
for i in range(1, n + 1):
    res = max(res, dfs(i))
print(res)

Buggy submission (verdict: Runtime Error):
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 01/08/2020

from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, m = iia()
dp = [-1] * (n + 1)
d = {}
for i in range(m):
    a, b = iia()
    d.setdefault(a, []).append(b)

def dfs(cur):
    if dp[cur] != -1:
        return dp[cur]
    t = 0
    for i in d.get(cur, []):
        t = max(1 + dfs(i), t)
    dp[cur] = t
    return dp[cur]

res = 0
for i in range(1, n + 1):
    res = max(res, dfs(i))
print(res)

Buggy submission (verdict: Runtime Error):
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 01/08/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, m = iia()
dp = [-1] * (n + 1)
d = {}
for i in range(m):
    a, b = iia()
    d.setdefault(a, []).append(b)

def dfs(cur):
    if dp[cur] != -1:
        return dp[cur]
    t = 0
    for i in d.get(cur, []):
        t = max(1 + dfs(i), t)
    dp[cur] = t
    return dp[cur]

res = 0
for i in range(1, n + 1):
    res = max(res, dfs(i))
print(res)
Problem p02804 (python)

Fixed submission:
N, K = map(int, input().split())
A = [int(x) for x in input().split()]


def solve(N, K, A):
    A.sort()
    res = 0
    MOD = 10**9 + 7
    fact_table = [1] * (N + 1)
    inv_fact_table = [1] * (N + 1)
    for i in range(1, N + 1):
        fact_table[i] = fact_table[i - 1] * i % MOD

    def inverse(n):
        if n == 1:
            return 1
        q = MOD // n
        r = MOD % n
        return (MOD - q * inverse(r) % MOD) % MOD

    inv_fact_table[N] = inverse(fact_table[N])
    for i in range(N - 1, 0, -1):
        inv_fact_table[i] = inv_fact_table[i + 1] * (i + 1) % MOD

    def comb(n, k):
        return fact_table[n] * inv_fact_table[n - k] % MOD * inv_fact_table[k] % MOD

    s = [1, -1]
    for m in range(2):
        for i in range(K - 1, N):
            res = (res + s[m] * A[i] * comb(i, K - 1)) % MOD
        A = sorted(A, reverse=True)
    return (res + MOD) % MOD


print(solve(N, K, A))

Buggy submission (verdict: Runtime Error):
import random
N, K = map(int, input().split())
A = [int(x) for x in input().split()]


def solve(N, K, A):
    A.sort()
    res = 0
    MOD = 10**9+7

    def fact(n, k=1):
        ans = 1
        for i in range(n):
            ans *= i
        return ans

    def comb(n, k):
        return (fact(n)//(fact(n-k)*fact(k))) % MOD

    s = [1, -1]
    for m in range(2):
        for i in range(K-1, N):
            res = (res + s[m]*int((A[i])*comb(i, K-1))) % MOD
        A = sorted(A, reverse=True)
    return res


print(solve(N, K, A))

Buggy submission (verdict: Runtime Error):
import random
N, K = map(int, input().split())
A = [int(x) for x in input().split()]


def solve(N, K, A):
    A.sort()
    res = 0
    MOD = 10**9+7

    def fact(n, k=1):
        ans = 1
        for i in range(n):
            ans *= i
        return ans

    def comb(n, k):
        return (fact(n)//(fact(n-k)*fact(k))) % MOD

    s = [1, -1]
    for m in range(2):
        for i in range(K-1, N):
            res = (res + s[m]*int((A[i])*comb(i, K-1))) % MOD
        A = sorted(A, reverse=True)
    return res


print(solve(N, K, A))
N = 100000
K = random.randint(1, N)
A = [random.randint(-10000, 100000) for i in range(N)]
print(solve(N, K, A))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort()
res = 0
MOD = 10**9+7
nCk_2 = dict()
def fact(n, k=1):
    if n == 0:
        return 1
    if n <= k:
        return 1
    return n*fact(n-1)
def comb(n, k):
    return (fact(n)//(fact(n-k)*fact(k)))%MOD
s = [1,-1]
for m in range(2):
    for i in range(K-1,N):
        res = (res + s[m]*int((A[i])*comb(i,K-1)))%MOD
    A = sorted(A, reverse=True)
print(res)
Problem p02628 (python)

Fixed submission:
_,k=map(int,input().split())
print(sum(sorted(list(map(int,input().split())))[:k]))

Buggy submission (verdict: Runtime Error):
_,k=map(int,input().split())
print(sum(sorted(list(map(int,input(),split())))[:k]))
Problem p03150 (python)

Fixed submission:
S = input()
for i in range(7):
    if S[:i] + S[-7+i:] == 'keyence':
        print('YES')
        exit()
print('NO')

Buggy submission (verdict: Runtime Error):
S = input()
K = 'keyence'

bf = False
judge = False
kn = 0
for i in range(len(S)):
    if S[i] == K[kn]:
        if bf == True:
            judge = True
        kn += 1
    else:
        if judge == True:
            print('NO')
            exit()
        if bf == True:
            continue
        else:
            bf = True

if kn == 7:
    print('YES')
else:
    print('NO')
Problem p03212 (python)

Fixed submission:
A = []
str = "357"
lim = 11

def dfs(bef, sz):
    if sz + 1 == lim:
        return
    for i in str:
        t = bef + i
        A.append(t)
        dfs(t, sz + 1)

def main():
    n = int(input())

    dfs("", 0)

    ans = 0

    for a in A:
        q = False
        w = False
        e = False
        for i in a:
            if i == '3':
                q = True
            elif i == '5':
                w = True
            elif i == '7':
                e = True
        if q and w and e:      
            ai = int(a)
            if ai <= n:
                ans += 1

    print(ans)

main()

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int n;
int lim;
vector<string> A;

void f(int digitNum, string s){ 
    vector<bool> J(3, false);
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '3') J[0] = true;
        if(s[i] == '5') J[1] = true;
        if(s[i] == '7') J[2] = true;
    }
    int idx = find(J.begin(), J.end(), false) - J.begin();
    if(idx == 3){
        A.push_back(s);
    }
    if(digitNum == lim){
        return;
    }
    f(digitNum + 1, s + '3');
    f(digitNum + 1, s + '5');
    f(digitNum + 1, s + '7');
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n;
    
    lim = to_string(n).length();
    
    if(lim < 3){
        cout << 0 << endl;
        return 0;
    }

    f(0, "");

    vector<int> B(A.size());
    for(int i = 0; i < A.size(); i++){
        B[i] = stoi(A[i]);
    }

    sort(B.begin(), B.end());

    int idx = lower_bound(B.begin(), B.end(), n) - B.begin();

    cout << idx + (B[idx] == n) << endl;

    return 0;
}
Problem p03261 (python)

Fixed submission:
def main():
    n = int(input())
    
    tmp = ""
    f = True
    st = []
    for i in range(n):
        w = input()
        st.append(w)
        if i > 0:
            if tmp[-1] == w[0]:
                pass
            else:
                f = False
        tmp = w
    if len(list(set(st))) != n:
        f = False
    
    print("Yes" if f else "No")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
N=int(input())
W=[]
S=set()
for i in range(N):
    w=input()
    W.append(w)
    last=W[0][-1]
S.add(W[0])
    
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(w[i])
    last=w[i][-1] #ケツ追加した
print("Yes")
Problem p03294 (python)

Fixed submission:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    print(sum(A) - n)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
n=input()
A=list(map(int,input.split()))
t=sum(A)-1
ans=0
for a in A:
    ans += t % a
print(ans)
Problem p03328 (python)

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

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

Fixed submission:
def main():
    N = int(input())
    M = list(map(int, list(str(N))))

    t = 0
    for m in M:
        t += m

    if N % t == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

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

fx = 0
for x in X:
    fx += int(x)

if X % fx == 0:
    print("Yes")
else:
    print("No")
Problem p03545 (python)

Fixed submission:
def main():
    A = list(map(int,str(input())))

    s1 = "+"
    s2 = "+"
    s3 = "+"    

    if A[0] + A[1] + A[2] + A[3] == 7:
        s1 = "+"
        s2 = "+"
        s3 = "+"
    elif A[0] + A[1] + A[2] - A[3] == 7:
        s1 = "+"
        s2 = "+"
        s3 = "-"
    elif A[0] + A[1] - A[2] + A[3] == 7:
        s1 = "+"
        s2 = "-"
        s3 = "+"
    elif A[0] - A[1] + A[2] + A[3] == 7:   
        s1 = "-"
        s2 = "+"
        s3 = "+"
    elif A[0] + A[1] - A[2] - A[3] == 7:   
        s1 = "+"
        s2 = "-"
        s3 = "-"
    elif A[0] - A[1] + A[2] - A[3] == 7:   
        s1 = "-"
        s2 = "+"
        s3 = "-"
    elif A[0] - A[1] - A[2] + A[3] == 7:   
        s1 = "-"
        s2 = "-"
        s3 = "+"
    elif A[0] - A[1] - A[2] - A[3] == 7:   
        s1 = "-"
        s2 = "-"
        s3 = "-"

    print(str(A[0]) + s1 + str(A[1]) + s2 + str(A[2]) + s3 + str(A[3]) + "=7")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
A, B, C, D = input()

op = ['+', '-']

for i in op:
    tmp = A + i + B
    for j in op:
        tmp += j + C
        for k in op:
            tmp += k + D
            if eval(tmp) == 7:
                print(tmp + '=7')
                exit()
Problem p03658 (python)

Fixed submission:
n,k=input().split()
print(sum(sorted(list(map(int,input().split())))[:-int(k)-1:-1]))

Buggy submission (verdict: Runtime Error):
# NとKを数値入力させる
N, K = map(int, input().split())

# 棒を入れるリストを用意する
A = []

# N本の棒の長さを入力させる
for i in range(N):
    # 数字を1つ入力させる
    a = int(input())

    # リストAに追加する
    A.append(a)

# リストAをソートする．このとき引数にreverse = Trueを設定すると降順になる（デフォルトは昇順）
A = sorted(A, reverse = True)

# 現在リストAには大きい順に棒の長さが格納されている．
# 大きい方からK本の長さの総和が最大値なので初期値0にしてK本分足していく
ans = 0
for i in range(K):
    ans += A[i]

print(ans)
Problem p03693 (python)

Fixed submission:
print(["NO","YES"][int(input().replace(" ", ""))%4==0])

Buggy submission (verdict: Runtime Error):
r, g, b = input().split()
a = int(r + g + b)
print(["YES", "NO"][a % 4])
Problem p03697 (python)

Fixed submission:
a=eval(input().replace(" ","+"))
print(["error",a][a<10])

Buggy submission (verdict: Runtime Error):
A = map(int, input().split())
total = A[0] + A[1]
if total >= 10:
	print('error')
else:
	print(total)
Problem p03737 (python)

Fixed submission:
def main():
    s1, s2, s3 = list(input().split())
    print(s1[0].upper() + s2[0].upper() + s3[0].upper())

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
a=int(input())-int(input())
print(['LESS','EQUAL','GREATER'][a>=0 + a==0])
Problem p03760 (python)

Fixed submission:
print("".join([a+b for a,b in zip(input(),input()+" ")]))

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

ans = ''
for i in range(min(len(O), len(E)):
    ans += O[i]
    ans += E[i]

if len(O) > len(E):
    ans += O[i]
elif len(O) < len(E):
    ans += E[i]

print(ans)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

ans = ''
for i in range(min(O, E)):
    ans += O[i]
    ans += E[i]

if len(O) > len(E):
    ans += O[i]
elif len(O) < len(E):
    ans += E[i]

print(ans)
Problem p03999 (python)

Fixed submission:
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
    tmp = ''
    for j in range(len(s)):
        tmp += s[j]
        if i >> j & 1 == 1:
            tmp += '+'
    else:
        ans += eval(tmp)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
    tmp = ''
    for j in range(len(s)):
        tmp += s[j]
        if i >> j & 1:
            tmp += '+'
    else:
        ans += eval(tmp)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    ans = 0
    for i in range((len(s) - 1) ** 2):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if (i >> j) & 1:
                tmp += "+"
        else:
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    ans = 0
    for i in range((len(s) - 1) ** 2):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if (i >> j) & 1:
                tmp += "+"
        else:
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()
Problem p03060 (python)

Fixed submission:
# coding: utf-8
# Your code here!
V=[]
C=[]

ans=0
N=0
i=0
N=int(input())

li = input().split()

while(i<N):
    V.append(int(li[i]))
    i=i+1

i=0
li2=0
li2=input().split()

while(i<N):
    C.append(int(li2[i]))
    i = i+1
    
i=0

while(i<N):
    if(V[i]>C[i]):
        ans = ans + V[i] - C[i]
    i = i+1

print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np
N = int(input())

v = list(map(int,input().split()))
c = list(map(int,input().split()))

v2=np.array(v)
c2=np.array(c)

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[0] + v2[2]
y = c2[0] + c2[2]
print(x-y)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np
N = int(input())

v = list(map(int,input().split()))
c = list(map(int,input().split()))

v2=np.array(v)
c2=np.array(c)

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[-1] + v2[-2]
y = c2[-1] + c2[-2]
print(x-y)
Problem p03071 (python)

Fixed submission:
#coding: utf-8
a, b = map(int, input().split())
result = 0
     
if(a>b):
    result += a
    a = a-1
else:
    result += b
    b = b-1
     
result += max(a,b)
print(result)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count++
        
print(count)

Buggy submission (verdict: Runtime Error):
#coding: utf-8
a, b = map(int, input().split())
result = 0

if(a>b):
    result += a
    a = a-1
else:
    resu += b
    b = b-1

result += max(a,b)
print(result)