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

Fixed submission:
def main():
    #print = out.append
    ''' Cook your dish here! '''
    x, y = get_list()
    res = 100000 * (4-x) if x<=3 else 0
    res += 100000 * (4-y) if y<=3 else 0
    if x==1 and y==1: res += 400000
    print(res)


''' Coded with love at India by Satyam Kumar '''
import sys
#from collections import defaultdict
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')

Buggy submission (verdict: Runtime Error):
def main():
    #print = out.append
    ''' Cook your dish here! '''
    n = get_int()
    print("?", " ".join(map(str, range(1, 1 + n))), flush=True)
    start = input()
    ptr = 0
    res = ['' for _ in range(2*n)]
    for i in range(2, n+2):
        print("?", " ".join(map(str, range(i, i+n))), flush=True)
        cr = input()
        ptr += 1
        if cr!=start:
            res[ptr-1] = start[0]
            res[ptr + n - 1] = 'R' if res[ptr-1]!='R' else 'B'
            break
    outer = list(range(1, ptr)) + list(range(ptr+n+1, (2*n)+1))
    inner = list(range(ptr+1, ptr + n))
    for i in outer:
        print("?", i, " ".join(map(str, inner)), flush=True)
        res[i-1] = input()[0]
    for i in inner:
        print("?", i, " ".join(map(str, outer)), flush=True)
        res[i-1] = input()[0]
    print("!", "".join(res), flush=True)


''' Coded with love at India by Satyam Kumar '''
import sys
#from collections import defaultdict
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
#print(*out, sep='\n')
Problem p02814 (python)

Fixed submission:
#!/usr/bin/env python

from sys import stdin
from math import floor

N, M = (int(wd) for wd in stdin.readline().split())
a = [int(wd) for wd in stdin.readline().split()]

def kouyakusuu(g1, g2):
    if g1 < g2:
        return kouyakusuu(g2, g1)
    if g2 == 0:
        return g1
    return kouyakusuu(g2, g1 % g2)

def koubaisuu(g1, g2):
    return (g1 * g2) // kouyakusuu(g1, g2)




def solve2(N, M, a):
    ret = 1
    cnt2 = 1
    while a[0] % (2**cnt2) == 0: cnt2 += 1
    ng = 2 ** cnt2
    cnt2 -= 1
    ok = 2 ** cnt2
    for aa in a:
        if aa % ng == 0:
            return 0
        if aa % ok != 0:
            return 0
        ret = koubaisuu(ret, aa // 2)
    return int(floor((M - ret) / (ret * 2)) + 1)

print(solve2(N, M, a))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

from sys import stdin
from math import ceil

N, M = (int(wd) for wd in stdin.readline().split())
a = [int(wd) for wd in stdin.readline().split()]

def kouyakusuu(g1, g2):
    if g1 == 0 or g2 == 0:
        return g1
    return kouyakusuu(g2, g1 % g2)

def jouyo(g1, g2):
    M1, P1 = g1
    M2, P2 = g2
    if M1 < M2:
        M1, M2 = M2, M1
        P1, P2 = P2, P1
    ret = P1
    for _ in range(M2):
        if ret % M2 == P2:
            break
        ret += M1
        pass
    if ret % M2 != P2:
        return None
    return (M1 * M2 / kouyakusuu(M1, M2), ret)

cur = (a[0], a[0] // 2)
for aa in a[1:]:
    cur = jouyo(cur, (aa, aa//2))
    if cur is None:
        break
if cur is None:
    print(0)
else:
    print(int(ceil((M - cur[1]) / cur[0] + 1)))
Problem p02658 (python)

Fixed submission:

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

def main():
  if(0 in A):
    print(0)
    return

  products = 1
  for a in A:
    products *= a
    if(products > 1000000000000000000):
      print(-1)
      return
  print(products)
  return

main()

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
 
 
long long LIMIT = 1000000000000000000;
 
int main(){
  int n;
  cin >> n;
  vector<long long> vec(n);
  
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  
  if ( std::find(vec.begin(), vec.end(), 0) != vec.end() ) {
    cout << 0 << endl;
    return 0;
  }
  
  long long products = 1;
  for (int i = 0; i < n; i++) {
    products *= vec.at(i);
	if(products > LIMIT) {
      cout << -1 << endl;
      return 0;
    }
  }
  
  cout << products << endl;
  
  return 0;
Problem p02772 (python)

Fixed submission:
N = input()
A = map(int, input().split())
def main():
  for a in A:
    if a%2 == 0:
      if a%3 != 0 and a%5 != 0:
        print('DENIED')
        return
  print('APPROVED')
  return

main()

Buggy submission (verdict: Runtime Error):
3
28 27 24
Problem p02952 (python)

Fixed submission:
n = int(input())
c=0
for r in [i+1 for i in range(0, len(str(n))) if i%2==0]:
  for i in range(10**(r-1), min(n+1, 10**r)):
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
c=0
for r in [i+1 for in range(len(str(n))) if i%2==1]:
  for i in range(10**(r-1), min(n+1, 10**r)):
    c++n
print(c)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map( int, input().split()))
def solve():
  for i in range(N-1, 0, -1):
    if H[i-1]-H[i]>1:
      return False
    if H[i-1]-H[i]==1:
      H[i-1]-=1
  return True

print('Yes' if solve() else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map( int, input().split()))
def solve():
  for i in range(N-1, 0, -1):
    if H[i-1]-H[i]>1>
    return False
  return True

print('Yes' if solve() else 'No')
Problem p03023 (python)

Fixed submission:
n = int(input())
print(180*(n-2))

Buggy submission (verdict: Runtime Error):
A = int(input())
print(180*(n-2))
Problem p03060 (python)

Fixed submission:
N = int(input())
cost = [int(c)-int(v) for c,v in zip(input().split(), input().split())]
print(sum([c if c>0 else 0 for c in cost]))

Buggy submission (verdict: Runtime Error):
N = int(input())
cost = [int(c)-int(v) for c,v in zip(input(), input())]
print(sum([c if c>0 else 0 for c in cost]))
Problem p03085 (python)

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

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

Fixed submission:
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 and month<5:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 && month<5:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
year, month, day = map(int, input().split("/"))

if year<2019:
  print("Heisei")
elif year == 2019 && month<5:
  print(Heisei)
else:
  print("TBD")
Problem p03206 (python)

Fixed submission:
D = int(input())
print("Christmas "+" ".join(["Eve" for i in range(25-D)]))

Buggy submission (verdict: Runtime Error):
D = int(input())
print("Cristmas "+" ".joined(["eve" for i in range(25-D)]))
Problem p03289 (python)

Fixed submission:
s = input()
print("AC" if(s[0] == "A" and s[2:len(s)-1].count("C") == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower()) else "WA")

Buggy submission (verdict: Runtime Error):
s = input()
print("AC" if(s[0] == "A" and s[2:len(s)-1].count("C") == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower())
Problem p03352 (python)

Fixed submission:
x = int(input())

def isPrime(n):
  if n%2 == 0 or n%3 == 0: return True
  if n<3: return False
  for i in range( 2, int(n**0.5) +1):
    if n%i == 0: return False
  return True

primes = [i for i in range(1, 32) if isPrime(i)]

def isExp(n):
  if n==1: return True
  for i in [p for p in primes if p<int(n**0.5)+1]:
    p = 0
    while i**p<=n:
      if i**p == n: return True
      p+=1
  return False

def solve():
  for i in range(x,0,-1):
    if isExp(i): return i

print(solve())

Buggy submission (verdict: Runtime Error):
x = int(input())
def isExp(num):
	if num ==1 : return True
	for i in range(2,11):
		pow(num, 1/i) % 1.0 == 0.0: return True
	return False
def solve():
	for i in range(x,0,-1):
		if isExp(i): return i

print(solve())

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

def isPrime(n):
  if n%2==0 or n%3==0: return True
  for i in range(2, int(n**0.5)+1):
    if n%i==0: return False
  return True
primes = [i for i in range(2,1000) if isPrime(i)]

def isExponentiation(n):
  i = 0
  flag = False
  while(primes[i]<n):
    if n%primes[i]==0:
      if flag: return False
      else: flag = True
    i+=1
  return flag

print( max([i for i in range(x) if isExponentiation(i)]) )
Problem p03495 (python)

Fixed submission:
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))

def solve():
  c = list(collections.Counter(a).values())
  c.sort()
  if(len(c)<=k):
    print(0)
  else:
    print(sum(c[:len(c)-k]))

solve()

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

def solve():
  a.sort()
  c = [a.count(i) for i in range(1,n+1) if a.count(i)>0]
  c.sort()
  if(len(count)<=k):
    print(0)
  else:
    print(sum(count[:len(c)-k]))

solve()
Problem p03548 (python)

Fixed submission:
X, Y, Z = map(int, input().split())
def solve():
  for i in range(int(X/Y)+2):
    if(X < i*Y+(i+1)*Z):
      print(i-1)
      return

solve()

Buggy submission (verdict: Runtime Error):
X, y, Z = map(int, input().split())
def solve():
  for i in range(int(X/Y)):
    if(X < i*Y+(i+1)*Z):
      print(i-1)
      return

solve()
Problem p03555 (python)

Fixed submission:
print("YES" if input() == "".join(list(reversed(input()))) else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if input() == reversed(input()) else "No)
Problem p03860 (python)

Fixed submission:
print("".join(([s[0] for s in input().split()])))

Buggy submission (verdict: Runtime Error):
print(sum([s[0] for s in input().split()]))
Problem p02678 (python)

Fixed submission:
import sys
from collections import deque


N, M = [int(i) for i in input().split()]
A = []
B = []
for i in range(M):
    l = [int(i) for i in input().split()]
    A.append(l[0])
    B.append(l[1])

# BFS
G = [[] for _ in range(N)]
for i in range(M):
    G[A[i] - 1].append(B[i] - 1)
    G[B[i] - 1].append(A[i] - 1)
# G = [list(set(x)) for x in G]

q = deque([])
ans = [-1] * N
ans[0] = 0
q.appendleft(0)
while(len(q) > 0):
    v = q.pop()
    for nv in G[v]:
        if not ans[nv] == -1:
            continue
        ans[nv] = v
        q.appendleft(nv)

# for i in ans[1:]:
#     if i == -1:
#         print('No')
#         sys.exit()

for i, v in enumerate(ans):
    if i == 0:
        print('Yes')
        continue
    print(v + 1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque


N, M = [int(i) for i in input().split()]
A = []
B = []
for i in range(M):
    l = [int(i) for i in input().split()]
    A.append(l[0])
    B.append(l[1])

# BFS
G = [[] for _ in range(N)]
for i in range(N):
    G[A[i] - 1].append(B[i] - 1)
    G[B[i] - 1].append(A[i] - 1)
G = [list(set(x)) for x in G]

q = deque([])
dist = [-1] * N
ans = [-1] * N
ans[0] = 0
dist[0] = 0
q.appendleft(0)
while(len(q) > 0):
    v = q.pop()
    for nv in G[v]:
        if not dist[nv] == -1:
            continue
        dist[nv] = dist[v] + 1
        ans[nv] = v
        q.appendleft(nv)

for i in ans[1:]:
    if i == -1:
        print('No')
        sys.exit()

for i, v in enumerate(ans):
    if i == 0:
        print('Yes')
        continue
    print(v + 1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque


N, M = [int(i) for i in input().split()]
A = []
B = []
for i in range(M):
    l = [int(i) for i in input().split()]
    A.append(l[0])
    B.append(l[1])

# BFS
G = [[] for _ in range(N)]
for i in range(N):
    G[A[i] - 1].append(B[i] - 1)
    G[B[i] - 1].append(A[i] - 1)
G = [list(set(x)) for x in G]

q = deque([])
dist = [-1] * N
ans = [-1] * N
dist[0] = 0
q.appendleft(0)
while(len(q) > 0):
    v = q.pop()
    for nv in G[v]:
        if not dist[nv] == -1:
            continue
        dist[nv] = dist[v] + 1
        ans[nv] = v
        q.appendleft(nv)

for i in ans[1:]:
    if i == -1:
        print('No')
        sys.exit()

for i, v in enumerate(ans):
    if i == 0:
        print('yes')
        continue
    print(v + 1)
Problem p02684 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
import collections


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    cur = 1
    c = {}
    route = []
    roop = None
    while (True):
        if cur in c:
            roop = cur
            break
        route.append(cur)
        c[cur] = 1
        cur = A[cur - 1]
    idx = route.index(roop)
    if K <= idx:
        print(route[K])
        return
    # route = route[idx:]
    print(route[(K - idx) % (len(route) - idx) + idx])
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import collections


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    cur = 1
    c = {}
    route = []
    roop = None
    while (True):
        if cur in c:
            roop = cur
            break
        route.append(cur)
        c[cur] = 1
        cur = A[cur - 1]
    idx = route.index(roop)
    if K <= idx:
        print(route[K])
        return
    route = route[idx:]
    print(route[K % len(route) - idx])
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import collections


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    cur = 1
    c = {}
    route = []
    roop = None
    while (True):
        if cur in c:
            roop = cur
            break
        route.append(cur)
        c[cur] = 1
        cur = A[cur - 1]
    idx = route.index(roop)
    if K <= idx:
        print(route[k])
        return
    route = route[idx:]
    print(route[K % len(route) - idx])
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import collections


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    cur = 1
    c = {}
    route = []
    roop = None
    while (True):
        if cur in c:
            roop = cur
            break
        route.append(cur)
        c[cur] = 1
        cur = A[cur - 1]
    idx = route.index(roop)
    route = route[idx:]
    print(route[K % len(route) - idx])
    return


if __name__ == '__main__':
    main()
Problem p02705 (python)

Fixed submission:
import sys
import math

R = input()
print(2.0 * math.pi * float(R))

Buggy submission (verdict: Runtime Error):
import math

R = input()
print(2 * math.pi * R)

Buggy submission (verdict: Runtime Error):
import math

R = input()
print(2 * math.pi * R)
Problem p02690 (python)

Fixed submission:
import collections
X = int(input())

for i in range(1000):
    for j in range(-1000,1000):
        if i**5 - j**5 == X:
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
H = list(map(int,input().split()))
AB = [0]*M
for i in range(M):
    AB[i] = list(map(int,input().split()))

GD = [0]*N

for A ,B in AB:
    HA = H[A-1]
    HB = H[B-1]
    if HA < HB:
        GD[A-1] -= 1
    elif HA > HB:
        GD[B-1] -= 1
    else:
        GD[A-1] -= 1
        GD[B-1] -= 1

ans = 0
for i in GD:
    if i == 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
H = list(map(int,input().split()))
AB = [0]*M
for i in range(M):
    AB[i] = list(map(int,input().split()))

GD = [0]*N

for A ,B in AB:
    HA = H[A-1]
    HB = H[B-1]
    if HA < HB:
        GD[A-1] -= 1
    elif HA > HB:
        GD[B-1] -= 1
    else:
        GD[A-1] -= 1
        GD[B-1] -= 1

ans = 0
for i in GD:
    if i == 0:
        ans += 1
print(ans)
Problem p02721 (python)

Fixed submission:
n,k,c=map(int, input().split())
s=input()
L=[0]*k
R=[0]*k
m=0
l=0
for i in range(k):
    while s[m]=="x":
        m+=1
    L[i]=m
    m+=c+1
    while s[n-l-1]=="x":
        l+=1
    R[i]=n-l-1
    l+=c+1
for i in range(k):
    if R[k-i-1]==L[i]:
        print(L[i]+1)

Buggy submission (verdict: Runtime Error):
n,k,c=map(int, input().split())
s=input()
L=[]
R=[]
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[m]=="o":
        L.append(m)
        m+=c
    m+=1
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[n-m-1]=="o":
        R.insert(0,n-m-1)
        m+=c
    m+=1
for i in range(k):
    if R[i]==L[i]:
        print(R[i]+1)

Buggy submission (verdict: Runtime Error):
n,k,c=map(int, input().split())
s=input()
L=[]
R=[]
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[m]=="o":
        L.append(m)
        m+=c
    m+=1
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[n-m-1]=="o":
        R.append(n-m-1)
        m+=c
    m+=1
for i in range(k):
    if R[i]==L[i]:
        print(R[i]+1)
Problem p02795 (python)

Fixed submission:
import math
h = int(input())
w = int(input())
n = int(input())
if h < w:
    h = w
print(math.ceil(n / h))

Buggy submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
if h < w:
    h = w
print(int(n / h))

Buggy submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
if h < w:
    h = w
print(int(n / h)
Problem p03164 (python)

Fixed submission:
n,wmax=map(int,input().split())
v=[0]*n
w=[0]*n
for i in range(n):
    w[i],v[i]=list(map(int,input().split()))
sv=sum(v)+1
dp=[[float('inf')]*sv for _ in range(n)]
dp[0][v[0]-1]=w[0]
for i in range(n):
    dp[i][0]=0
for i in range(n):
    for j in range(sv):
        dp[i][j]=min(dp[i-1][j],dp[i-1][j-v[i]]+w[i])
ans=float('inf')
for p in range(sv-1,-1,-1):
    if dp[n-1][p]!=ans and dp[n-1][p]<=wmax:
        ans=p
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n,maxw=map(int,input().split())
nap=[0]*n
for i in range(n):
    nap[i]=list(map(int,input().split()))
dp=[[0]*(maxw+1) for _ in range(n)]
for i in range(n):
    for j in range(maxw+1):
        if nap[i][0]>j:
            dp[i][j]=dp[i-1][j]
        else:
            dp[i][j]=max(dp[i-1][j],dp[i-1][j-nap[i][0]]+nap[i][1])
print(dp[n-1][maxw])

Buggy submission (verdict: Runtime Error):
N,W=map(int,input().split())
v=[0]*N
w=[0]*N
for i in range(N):
    v[i],w[i]=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N)]
for i in range(N):
    for j in range(1,W+1):
        if w[i]>j:
            dp[i][j]=dp[i-1][j]
        else:
            dp[i][j]=max(dp[i-1][j],v[i]+dp[i-1][j-w[i]])
print(dp[N-1][W])
Problem p03716 (python)

Fixed submission:
import heapq
n=int(input())
a=list(map(int,input().split()))
q=a[0:n]
sums=[0]*(n+1)
sums[0]=sum(q)
heapq.heapify(q)
am=a[n:2*n]
for i in range(0,n):
    heapq.heappush(q,am[i])
    sums[i+1]=sums[i]+am[i]-heapq.heappop(q)
p=a[2*n:3*n]
p=list(map(lambda x: x*(-1),p))
sump=sum(p)
sums[n]+=sump
heapq.heapify(p)
for i in range(n-1,-1,-1):
    heapq.heappush(p,(-1)*am[i])
    sump=sump-am[i]-heapq.heappop(p)
    sums[i]+=sump
print(max(sums))

Buggy submission (verdict: Runtime Error):
import heapq
n=int(input())
a=list(map(int,input().split()))
q=a[0:n]
heapq.heapify(q)
p=list(map(lambda x: x*(-1),a[2*n:3*n]))
heapq.heapify(p)
sums=sum(q)+[0]*(n-1)+sum(p)
am=a[n:2*n]
for i in range(0,n):
    heapq.heappush(q,am[i])
    heapq.heappop(q)
    sums[i+1]=sum(q)
for i in range(n-1,-1,-1):
    heapq.heappush(p,(-1)*am[i])
    heapq.heappop(p)
    sums[i]+=sum(p)
print(max(sums))

Buggy submission (verdict: Runtime Error):
import heapq
n=int(input())
a=list(map(int,input().split()))
q=a[0:n]
heapq.heapify(q)
p=list(map(lambda x: x*(-1),a[2*n:3*n]))
heapq.heapify(p)
sums=sum(q)+[0]*(n-1)+sum(p)
am=a[n:2*n]
for i in range(0,n):
    heapq.heappush(q,am[i])
    heapq.heappop(q)
    sums[i+1]=sum(q)
for i in range(n-1,-1,-1):
    heapq.heappush(p,(-1)*am[i])
    heapq.heappop(p)
    sums[i]+=sum(p)
print(max(sums))
Problem p04001 (python)

Fixed submission:
s=input()
ans=0
for i in range(1 << len(s)-1):
    l=[]
    for j in range(len(s)-1):
        if (i>>j)&1==1:
            l.append(s[j])
            l.append("+")
        else:
            l.append(s[j])
    l.append(s[len(s)-1])
    ans+=eval(''.join(l))
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for i in range(1 << len(s)-1):
    l=[]
    for j in range(len(s)-1):
        if (i>>j)&1==1:
            l.append(s[j])
            l.append("+")
        else:
            l.append(s[j])
    l.append(s[len(s)-1])
    sum+=eval(''.join(l))
print(sum)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for i in range(1 << len(s)-1):
    l=[]
    for j in range(len(s)-1):
        if (i>>j)&1==1:
            l.append(s[j])
            l.append("+")
        else:
            l.append(S[j])
    l.append(s[len(s)-1])
    sum+=eval(''.join(l))
print(sum)
Problem p02660 (python)

Fixed submission:
import math
def get_prime(n):
    if n <= 1:
        return []
    prime = [2]
    if n > 2:
        limit = int(math.sqrt(n))
        odd = [i for i in range(3, n + 1, 2)]
        while limit >= odd[0]:
            prime.append(odd[0])
            odd = [j for j in odd if j % odd[0] != 0]
        prime += odd
    return prime

from collections import defaultdict
def prime_factorization(n):
    if n <= 1:
        return {}
    else:
        # print(int(math.sqrt(n)))
        prime = get_prime(int(math.sqrt(n)))
        dct = defaultdict(int)
        for p in prime:
            while n % p == 0:
                dct[p] += 1
                n //= p
        if n != 1:
            dct[n] += 1
        dct = dict(dct)
        return dct

n = int(input())
pf = prime_factorization(n)

Z = []
for k, v in pf.items():
    for i in range(1, v + 1):
        Z.append(k ** i)
Z.sort()
count = 0
for z in Z:
    if n % z == 0:
        count += 1
        n //= z
    if n == 1:
        break

print(count)

Buggy submission (verdict: Runtime Error):
def p_facto(n):
    ret = []
    nc = n
    for i in range(2, nc):
        if i*i > nc:
            break
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            ret.append([i, ex])
    if n != 1:
        ret.append([n, 1])
    return ret


def main(N):
    ans = 0
    for p, e in pf:
        ex = 1
        while true:
            z = p**ex
            if N % z == 0:
                ans += 1
                N //= z
            else:
                break
            ex += 1
    print(ans)


if __name__ == "__main__":
    N = int(input())
    pf = p_facto(N)
    main(N)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
from collections import Counter

arr = prime_factorize(N)
c = Counter(arr)
cnt += len(c)
c = c.most_common()
for i in range(len(c)):
    cnt +=  c[i][1]-1//2

print(ans)