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

Fixed submission:
n,c,k=map(int,input().split())
t=[int(input()) for i in range(n)]
t=sorted(t)
time=t[0]
cnt=0
ans=0
for i in range(n):
    #制限時間以内かつC人以内
    if time+k>=t[i] and cnt<=c-1:
        cnt+=1

    else:
        ans+=1
        time=t[i]
        cnt=1
print(ans+1)

Buggy submission (verdict: Runtime Error):
n,c,k=map(int,input().split())
t=[int(input()) for i in range(n)]
t=sorted(t)
ans=0
cnt=0
first_time=t[0]
for i in range(n):
    time=t[i]-first_time
    cnt+=1
    if time==0:
        if i<=n-2 and t[i+1]-first_time>k:
            ans+=1
            first_time=t[i+1]
            cnt=0
        elif cnt==c:
            ans+=1
            first_time=t[i+1]
            cnt=0

    elif time>k:
        ans+=1
        first_time=t[i]
        cnt=0
    elif cnt==c:
        ans+=1
        first_time=t[i+1]
        cnt=0

    if i==n-1 and cnt!=0:
        ans+=1

print(ans)
Problem p03804 (python)

Fixed submission:
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

#二次元配列の部分配列を抽出する手法
#[l[i:m+i] for l in a[i:m+i]]
if m==1:
    for i in range(n):
        if b[0] in a[i]:
            print('Yes')
            exit()

    print('No')
    exit()
if m==n:
    if a==b:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

for i in range(n-m):
    for j in range(n-m):
        if [l[j:m+j] for l in a[i:m+i]]==b:
            print('Yes')
            exit()

print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

if m==1:
    for i in a:
        if b[0] in i:
            print('Yes')
            exit()
        else:
            print('No')
            exit()

for i in range(n-m+1):
    cnt=0
    while cnt < n - m:
        l=[]
        for j in range(n-m+1):
        #bと同じ長さの部分配列を作る
            l+=[a[j+cnt][i:i+m]]

        if l==b:
            print('Yes')
            exit()
        cnt+=1
print('No')
Problem p03252 (python)

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
RC110C
"""


s = list(input())
t = list(input())
n = len(s)

def exchange(a,b,c):
    if a != b and a!=c:
        return(a)
    elif a == b:
        return(c)
    elif a == c:
        return(b)

ans = 'Yes'

seen = set()
for i in range(n):
    sl = s.pop()
    tl = t.pop()
    if sl == tl:
        seen.add(sl)
    elif sl != tl and not tl in seen and not sl in seen:
        s = list(map(lambda a: exchange(a,sl,tl),s))
        seen.add(tl)
    else:
        ans = 'No'
        break

print(ans)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
RC110C
"""


s = list(input())
t = list(input())
n = len(s)

def exchange(a,b,c):
    if a != b and a!=c:
        return(a)
    elif a == b:
        return(c)
    elif a == c:
        return(b)

ans = 'Yes'

seen = set()
for i in range(n):
    sl = s.pop()
    tl = t.pop()
    if sl == tl:
        seen.add(sl)
    elif sl != tl and not tl in seen and not sl in seen:
        s = list(map(lambda a: exchange(a,sl,tl),s))
        seen.add(tl)
    else:
        ans = 'No'
        break
    print(s)

print(ans)
Problem p04050 (python)

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
agc001 D
"""

n, m = map(int, input().split())
ali = list(map(int, input().split()))

if m == 1 and ali[0] == 1:
    print(1)
    print(1)
    print(1)
    exit()

if m == 1:
    print(ali[0])
    print(2)
    print(ali[0]-1, 1)
    exit()

flag = 0
c = []
for a in ali:
    if a % 2 == 1:
        if flag == 0:
            lm = a
            flag += 1
        elif flag == 1:
            rm = a
            flag += 1
        elif flag == 2:
            print('Impossible')
            exit()
    else:
        c.append(a)

if flag == 0:
    lm = c[0]
    del c[0]
    rm = c.pop()

if flag == 1:
    rm = c.pop()

b = [lm+1] + c
d = [lm] + c + [rm]

if rm > 1:
    b.append(rm-1)


print(" ".join(map(str, d)))
print(len(b))
print(" ".join(map(str, b)))

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
agc001 D
"""

n, m = map(int, input().split())
ali = list(map(int, input().split()))

if m == 1:
    print(ali[0])
    print(2)
    print(ali[0]-1, 1)
    exit()

flag = 0
c = []
for a in ali:
    if a % 2 == 1:
        if flag == 0:
            lm = a
            flag += 1
        elif flag == 1:
            rm = a
            flag += 1
        elif flag == 2:
            print('Impossible')
            exit()
    else:
        c.append(a)

if flag == 1:
    rm = c.pop()

b = [lm+1] + c
d = [lm] + c + [rm]

if rm > 1:
    b.append(rm-1)


print(" ".join(map(str, d)))
print(len(b))
print(" ".join(map(str, b)))

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
agc001 D
"""

n, m = map(int, input().split())
ali = list(map(int, input().split()))

if m == 1:
    print(ali[0])
    print(1)
    print(ali[0]-1, 1)
    exit()

flag = 0
c = []
for a in ali:
    if a & 1:
        if flag == 0:
            lm = a
            flag += 1
        elif flag == 1:
            rm = a
            flag += 1
        elif flag == 2:
            print('Impossible')
            exit()
    else:
        c.append(a)

if flag == 1:
    rm = c.pop()

b = [lm+1] + c
d = [lm] + c + [rm]

if rm > 1:
    b.append(rm-1)


print(" ".join(map(str, d)))
print(len(b))
print(" ".join(map(str, b)))
Problem p02572 (python)

Fixed submission:
n=int(input())
s=input()
p=list(s.split())
s1=0
s2=0
for i in range(0,n):
  s1=s1+int(p[i])
  s2=s2+(int(p[i])*int(p[i]))
k= ((s1**2)-s2)//2
k=k%1000000007
print(k)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
p=list(s.split())
s1=0
s2=0
for i in range(0,n)
  s1=s1+int(p[i])
  s2=s2+(int(p[i])*int(p[i]))
k= ((s1**2)-s2)//2
k=k%1000000007

print(k)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
p=list(s.split())
s1=0
s2=0
for i in range(0,n)
  s1=s1+int(p[i])
  s2=s2+(int(p[i])*int(p[i]))
k= ((s1**2)-s2)//2
k=k%1000000007
//abcdef
print(k)
Problem p02577 (python)

Fixed submission:
print("Yes"if int(input())%9==0else"No")

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%0==0:
  print("Yes")
else:
  print("No")
Problem p02578 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n):
  if a[i-1]>a[i]
    ans+=a[i-1]-a[i]
    a[i]=a[i-1]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input()))
ans=0
for i in range(1,n):
  if a[i-1]>a[i]
    ans+=a[i-1]-a[i]
    a[i]=a[i-1]
print(ans)
Problem p02623 (python)

Fixed submission:
def main():
    from itertools import chain

    N, M, K = map(int, input().split())
    A = map(int, input().split())
    *B, = map(int, input().split())

    t = sum(B)
    ans = 0
    j = M
    for i, x in enumerate(chain([0], A)):
        t += x
        while j > 0 and t > K:
            j -= 1
            t -= B[j]
        if t > K: break
        if ans < i + j:
            ans = i + j
    print(ans)


if __name__ == '__main__':
    main()

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

a,b=[0],[0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans,j=0,M
for i in range(N + 1):
    if a[i]>K:
        break
    while b[j] > K - a[i]
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

a,b=[0],[0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans,j=0,M
for i in range(N + 1):
    if a[i]>K:
        break
    while b[j] > K - a[i]
        j -= 1
    ans = max(ans, i + j)
print(ans)
Problem p02627 (python)

Fixed submission:
a = input()
print('A' if a.isupper() else 'a')

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

ans = ""
while N > 0:
  x = (N-1) % 26

  ans = chr(ord('a') + x) + ans
  N = (N-1) // 26

print(ans)

Buggy submission (verdict: Runtime Error):
 a = input()
print('A' if a.isupper() else 'a')

Buggy submission (verdict: Runtime Error):
 a = input()
print('A' if a.isupper() else 'a')
Problem p02754 (python)

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

d = a+b
c = n%d
e = n//d

if c <= a:
    print(e*a+c)
if c > a:
    print((e+1)*a)

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

al = [1]*a
bl = [0]*b
cl =[]
d = a + b
e = n//d + 2

for i in range(e):
    cl = cl + al + bl

print(sum(cl[:n]))

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

al = [1]*a
bl = [0]*b
cl =[]

for i in range(20):
    cl = cl + al + bl

print(sum(cl[:n]))

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

al = [1]*a
bl = [0]*b
cl =[]

for i in range(n+1):
    cl = cl + al + bl

print(sum(cl[:n]))
Problem p02781 (python)

Fixed submission:
import sys
 
read = sys.stdin.read
 
 
def main():
    N, K = map(int, read().split())
 
    dp1 = [0] * (K + 1)
    dp2 = [0] * (K + 1)
    dp1[0] = 1
 
    for x in map(int, str(N)):
        for j in range(K, -1, -1):
            if j > 0:
                dp2[j] += dp2[j - 1] * 9
                if x != 0:
                    dp2[j] += dp1[j - 1] * (x - 1) + dp1[j]
                    dp1[j] = dp1[j - 1]
            else:
                dp1[j] = 0
                dp2[j] = 1
 
    print(dp1[K] + dp2[K])
    return
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n= int(input())
k= input()
ans = 0
L = [0]*(n+1)

for i in range(1,n+1):
    f = str(i)
    e = list(f)
    b = len(e) - e.count('0')
    L[i] = b
print(L.count(int(k)))
Problem p02881 (python)

Fixed submission:
import numpy
n = int(input())
l = []
ans = n

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

if is_prime(n) :
    print(n-1)
if is_prime(n) == False:
    for i in range(2,int(numpy.sqrt(n))+1):
        if n%i == 0:
            a = i
            b = n//i
            ans = min(n,a+b-2)
    print(ans)

Buggy submission (verdict: Runtime Error):
zimport numpy
n = int(input())
l = []

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

if is_prime(n) :
    print(n-1)
if is_prime(n) == False:
    for i in range(2,int(numpy.sqrt(n))+1):
        if n%i == 0:
            a = i
            b = n//i
            l.append(a+b-2)
    print(min(l))
Problem p03317 (python)

Fixed submission:
import math
n, k = map(int,input().split())
input()
print(math.ceil((n-1)/(k-1)))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
c=list(map(int, input().split()))
d -= 1
print(a//d)
Problem p02594 (python)

Fixed submission:
x = int(input())

if x >= 30:
    print("Yes")
else:
    print("No")

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

if x >= 30:
    print("Yes")
else:
    print("No")
Problem p02594 (python)

Fixed submission:
n = int(input())
if n >= 30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n >= 30:
  print('Yes')
 else:
  print('No')
Problem p02627 (python)

Fixed submission:
import string
alpha = input()

# alpha = 'a'

if alpha in string.ascii_lowercase:
  print('a')
else:
  print('A')

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

if alpha in string.ascii_lowercase:
  print('a')
else:
  print('A')
Problem p02659 (python)

Fixed submission:
from decimal import Decimal

# t = '1000000000000000 9.99'
a = list(map(Decimal, input().split()))
# a = list(map(Decimal, t.split()))

print(int(a[0]*a[1]))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

# t = '1000000000000000 9.99'

a = list(map(Decimal, t.split()))

print(int(a[0]*a[1]))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal 
a = map(Decimal, input().split())

print(a[0]*a[1])

Buggy submission (verdict: Runtime Error):
ab = input().split()
a, b = int(ab[0]), int(ab[1]*100)

print(int(a * b / 100))
Problem p02711 (python)

Fixed submission:
N = input()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
    if N[0] == '7' or N[1] == '7' or N[2] == '7':
        print("Yes")
    else:
        print("No")
Problem p02699 (python)

Fixed submission:
s,w=map(int,input().split())

if s<=w:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
    s=input()
    if s not in a:
        a.append(s)

print(len(a))
Problem p02879 (python)

Fixed submission:
a,b=map(int,input().split())
if a<10 and b<10:
  print(a*b)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a,b=map(int,intpu().split())
if a<10 and b<10:
  print(a*b)
else:
  print('-1')
Problem p02912 (python)

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))

for i in range(n):
    a[i]*=-1

heapq.heapify(a)
for _ in range(m):
    x=heapq.heappop(a)*(-1)
    x=x//2
    heapq.heappush(a,-x)

print(sum(a)*(-1))

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int, input().split())
a=sorted(list(map(int, input().split())),reverse=True)
tot=0
rate=[0]*n
p=[0]*n

for i in range(n-1):
  rate[i]=math.log2(a[i]/a[i+1])
  
cur=0
while m>0:
  if rate[cur]>0:
    p[cur]+=1
    rate[cur]-=1
    m-=1
    if cur>0:
      rate[cur-1]+=1
      cur-=1
  else:
    if cur+1<n
      cur+=1
    else:
      p[cur+1]+=1
      rate[cur+1]-=1
      rate[cur]+=1
      cur-=1
  
for i in range(n):
  tot+=int(a[i]/(2**p[i]))
print(tot)

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int, input().split())
a=sorted(list(map(int, input().split())),reverse=True)
tot=0
rate=[0]*n
p=[0]*n

for i in range(n-1):
  rate[i]=math.log2(a[i]/a[i+1])
  
cur=0
while m>0:
  if rate[cur]>0:
    p[cur]+=1
    rate[cur]-=1
    m-=1
    if cur>0:
      rate[cur-1]+=1
      cur-=1
  else:
    cur+=1
  
for i in range(n):
  tot+=int(a[i]/(2**p[i]))
print(tot)
Problem p02990 (python)

Fixed submission:
import math
n,k = map(int, input().split())
end=min(n-k+1,k)
ans=1
for i in range(1,end+1):
    ans=math.factorial(n-k+1)*math.factorial(k-1)//(math.factorial(i)*math.factorial(n-k+1-i)*math.factorial(i-1)*math.factorial(k-i))
    print(ans%(10**9+7))
if end==n-k+1:
    for _ in range(end+1,k+1):
        print("0")

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int, input().split())
end=min(n-k+1,k)
ans=1
for i in range(1,end+1):
    ans=math.factorial(n-k+1)*math.factorial(k-1)//(math.factorial(i)*math.factorial(n-k+1-i)*math.factorial(i-1)*math.factorial(k-i))
    print(ans%(10**9+7))
    if end=n-k+1:
        for _ in range(end+1,k+1)
        print(0)
Problem p03013 (python)

Fixed submission:
n,m= map(int, input().split())
if m!=0:
  a = [int(input()) for _ in range(m)]
else:
  a=[0]
dp=[0]*(n+1)
dp[0]=1
j=0

for i in range(1,n+1):
    if i==a[j]:
        if j<m-1:
            j+=1
    else:
        if i==1:
            dp[i]=1
        else:
            dp[i]=dp[i-1]+dp[i-2]

print(dp[n]%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m= map(int, input().split())
a = [int(input()) for _ in range(m)]
dp=[0]*(n+1)
dp[0]=1
j=0

for i in range(1,n+1):
    if i==a[j]:
        if j<m-1:
            j+=1
    else:
        if i==1:
            dp[i]=1
        else:
            dp[i]=dp[i-1]+dp[i-2]

print(dp[n]%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m= map(int, input().split())
a=[-1]
for i in range(m):
    a.append(int(input()))
a.append(n+1)
ans=1

def fib(x):
    if x==-1:
        count=0
    elif x==0:
        count=1
    else:
        count=fib(x-1)+fib(x-2)
    return count
    
for i in range(m+1):
    ans=ans*fib(a[i+1]-a[i]-2)
    
print(ans%1000000007)
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
arr=[]

for i in range(m):
    b,c=map(int,input().split())
    arr.append((b,c))

a=sorted(a)
arr=sorted(arr,key=lambda x:-x[1])

flag=0
left=0
for tup in arr:
    for i in range(left,min(left+tup[0],n)):
        if tup[1]>a[i]:
            a[i]=tup[1]
        else:
            flag=-1
            break
        if i==n-1:
            flag=-1
            break
    left+=tup[0]
    if flag==-1:
        break

print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
arr=[]

for i in range(m):
    b,c=map(int,input().split())
    arr.append((b,c))

a=sorted(a)
arr=sorted(arr,key=lambda x:-x[1])

flag=0
left=0
for tup in arr:
    for i in range(left,max(left+tup[0],n+1)):
        if tup[1]>a[i]:
            a[i]=tup[1]
        else:
            flag=-1
            break
        if i==n:
            flag=-1
            break
    left+=tup[0]
    if flag==-1:
        break

print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
arr=[]

for i in range(m):
    b,c=map(int,input().split())
    arr.append((b,c))

a=sorted(a)
arr=sorted(arr,key=lambda x:-x[1])

flag=0
left=0
for tup in arr:
    for i in range(left,left+tup[0]):
        if tup[1]>a[i]:
            a[i]=tup[1]
        else:
            flag=-1
            break
    left+=tup[0]
    if flag==-1:
        break

print(sum(a))
Problem p03315 (python)

Fixed submission:
s=input()
ans=0
for i in range(4):
  if s[i]=='+':
    ans+=1
  else:
    ans-=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
ans=0
for i in range(4):
  if s[i]=='+':
    ans+=1
  else:
    ans-=1
print(ans)
Problem p02571 (python)

Fixed submission:
S=list(map(str,input()))
T=list(map(str,input()))
X=[]
Z=0
for I in range(len(S)-len(T)+1):
    Y=S[I:I+len(T)]
    Z=0
    for J in range(len(T)):
        if Y[J]==T[J]:
            Z=Z+1
    X.append(Z)
if not X==[]:
    print(len(T)-max(X))
elif S==T:
    print(0)
else:
    print(len(T))

Buggy submission (verdict: Runtime Error):
S=list(map(str,input()))
T=list(map(str,input()))
X=[]
Z=0
for I in range(len(S)-len(T)):
    Y=S[I:I+len(T)]
    Z=0
    for J in range(len(T)):
        if Y[J]==T[J]:
            Z=Z+1
    X.append(Z)
print(len(T)-max(X))

Buggy submission (verdict: Runtime Error):
S=list(map(str,input()))
T=list(map(str,input()))
x=[]
y=0

for i in range(len(S)-len(T)):
    Y=S[i:i+len(T)]
    y=0
    for j in range(len(T)):
        if Y[j]==T[j]:
            y=y+1
    x.append(y)
print(len(T)-max(x))

Buggy submission (verdict: Runtime Error):
S=list(map(str,input()))
T=list(map(str,input()))
x=[]
y=0

for i in range(len(S)-len(T)):
    Y=S[i:i+len(T)]
    y=0
    for j in range(len(T)):
        if Y[j]==T[j]:
            y=y+1
    x.append(y)
print(len(T)-max(x))
Problem p02570 (python)

Fixed submission:
# -*- using:utf-8 -*-

class main:
  def judge(d, x):
    if d <= x:
      print("Yes")
    else:
      print("No")

if __name__ == "__main__":
  d, t, s = map(int, input().split())
  dis = t * s
  main.judge(d,dis)

Buggy submission (verdict: Runtime Error):
import itertools

if __name__ == "__main__":
  n = int(input())
  li = list(map(int, input().split()))
  array = list(itertools.combinations(li, 2))
  sum = 0
  for i in range(n):
    sum += array[i][0] * array[i][1]
  print(sum)
Problem p02572 (python)

Fixed submission:
# -*- using:utf-8 -*-

class main:
  def function(n, a):
    mod = 10 **9 +7
    S = [0] * (n + 1)
    for i in range(n):
      S[i + 1] = S[i] + a[i]
    SN = S[-1]
    ans = 0
    for i in range(n - 1):
      cnt = a[i] * (SN - S[i + 1])
      ans += cnt
    print(ans % mod)



if __name__ == "__main__":
  n = int(input())
  a = list(map(int, input().split()))
  main.function(n,a)

Buggy submission (verdict: Runtime Error):
# -*- using:utf-8 -*-
from itertools import combinations

if __name__ == "__main__":
  n = int(input())
  li = list(map(int, input().split()))
  array = list(combinations(li, 2))
  sum = 0
  for i in range(n):
    sum += array[i][0] * array[i][1]
  print(sum)

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
li = list(map(int, input().split()))
array = list(itertools.combinations(li, 2))
sum = 0
for i in range(n):
  sum += array[i][0] * array[i][1]
print(sum)

Buggy submission (verdict: Runtime Error):
# -*- using:utf-8 -*-
import itertools

if __name__ == "__main__":
  n = int(input())
  li = list(map(int, input().split()))
  array = list(itertools.combinations(li, 2))
  sum = 0
  for i in range(n):
    sum += array[i][0] * array[i][1]
  print(sum)
Problem p02594 (python)

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = input()
if X >= 30:
    print("Yes")
else:
    print("No")
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split(" ")))
cnt=0
for i in range(N):
    if i==0:
        cnt+=1
    else:
        h=H[i]
        c=0
        for j in range(i):
            if H[j]>h:
                c=1
        if c==0:
            cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split(" ")))
for i in range(N):
    if i==0:
        cnt+=1
    else:
        h=H[i]
        c=0
        for j in range(i):
            if H[j]>h:
                c=1
        if c==0:
            cnt+=1
print(cnt)