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

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


a=I()
b=I()
h=I()
ans=(a+b)*h//2
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


a,b,h=MI()
ans=(a+b)*h//2
print(ans)
Problem p02553 (python)

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

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

print(max(a*c,b*d,b*c,a*d))

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

print(max(a*c,b*d,b*c,a*d,0))
Problem p02554 (python)

Fixed submission:
n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9,n,MOD) + pow(8,n,MOD)
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9.n,MOD) - pow(8,n,MOD)
print(ans%MOD)
Problem p02642 (python)

Fixed submission:
n = int(input())
L = list(map(int,input().split()))
dp = [0]*((10**6)+1000)
for i in L:
    dp[i] +=1

one = []
for i in range(10**6+1000):
    if dp[i] == 1:
        one.append(i)

dp = [0]*((10**6)+1000)
a = list(set(L))
for i in a:
    for j in range(2*i,10**6+1000,i):
        dp[j] = 1

ans = 0
for i in one:
    if dp[i] == 0:
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
dp = [0]*(2*(10**5)+1000)
for i in range(n):
    dp[L[i]] +=1

one = []
for i in range(len(dp)):
    if dp[i] == 1:
        one.append(i)

dp = [0]*(2*(10**5)+1000)
a = list(set(L))
for i in L:
    for j in range(2*i,(2*(10**5)+1000),i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
dp = [0]*(2*(10**5)+1000)
for i in range(n):
    dp[L[i]] +=1

one = []
for i in range(len(dp)):
    if dp[i] == 1:
        one.append(i)

dp = [0]*(2*(10**5)+1000)
a = list(set(L))
for i in L:
    for j in range(2*i,max(L)+1,i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

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

dp = [0]*(2*(10**5)+1000)
one = list(set(L))
for i in L:
    for j in range(2*i,max(L)+1,i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

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

dp = [0]*(2*(10**5)+1000)
one = []
for i in range(n):
    if L.count(L[i]) == 1:
        one.append(L[i])

for i in L:
    for j in range(2*i,max(L)+1,i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

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

dp = [0]*(2*(10**5)+1000)
one = []
for i in range(n):
    if L.count(L[i]) == 1:
        one.append(L[i])

for i in L:
    for j in range(2*i,max(L)+1,i):
        if not dp[j-1]:
            dp[j-1] = 1

ans = 0
for i in one:
    if dp[i-1] == 0:
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
L = list(set(L))
l = len(L)
if l == 1:
    print(0)
    exit()
L.sort()
#print(L)
dp = [0]*(L[-1]*2+1)

for i in range(l):
    j = 1
    while L[i]*(j+1) <= len(dp):
        if not dp[L[i]*(j+1)]:
            dp[L[i]*(j+1)] = 1
        j +=1
#print(dp)
cnt = 0
for i in range(l):
    if dp[L[i]] == 0:
        cnt +=1
print(cnt)
Problem p02660 (python)

Fixed submission:
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5,21:6,22:6,23:6,24:6,25:6,27:6,28:7,29:7,30:7,31:7,32:7,33:7,34:7,35:7,36:8,39:8,40:8}
L = pr(n)
#print(L)
L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5}
L = pr(n)
#print(L)
L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5}
L = pr(n)
#print(L)
L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5}
L = pr(n)
#print(L)
L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5}
L = pr(n)
#(L)
L = Counter(L)
num = 0
for k,v in L.items():
    if v%2 == 1:
        num +=dic[v]
    else:
        num +=dic[v]
print(num)
Problem p02687 (python)

Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
elif s == "ARC":
    print("ABC")

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

if s == "ABC":
    print("ARC")
elif s = "ARC":
    print("ABC")
Problem p02690 (python)

Fixed submission:
n = int(input())
for i in range(1,121):
    for j in range(-121,121):
        if i**5 - j**5 == n:
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
def divisor(n):
    L = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            L.append(i)
            L.append(n//i)
    return L
    
n = int(input())
li = sorted(divisor(n))

for i in range(len(li)):
    a = (n - (li[i])**5)**0.2
    a1 = (n - (li[i])**5)**0.2
    b1 = (n-a**5)**0.2

    a1 = round(a1)
    b1 = round(b1)
    if a1**5 - b1**5 == n:
        print(a1,b1)
        exit()
    elif a1**5 + b1**5 == n:
        print(a1,-b1)
        exit()
Problem p02705 (python)

Fixed submission:
r = int(input())
print(2*r*3.141592653)

Buggy submission (verdict: Runtime Error):
r = int(input())
print(2*r*3. 141592653)
Problem p02719 (python)

Fixed submission:
n,k = map(int,input().split())
#L = list(map(int,input().split()))
#a = max(n,k)%min(n,k)


if n >= k:
    n = n%k
print(min(n,abs(n-k)))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
#L = list(map(int,input().split()))
#a = max(n,k)%min(n,k)
L = []
a = 1
while a <=10:
    if  max(n,k)%min(n,k) == 0:
        print(0)
        exit()
    if n >= k and k!=0:
        n = n%k
        if n == 0:
            print(k)
    elif n<k and n!=0:
        k = k%n
        if k == 0:
            print(n)
    L.append((n,k))
    a +=1
Problem p02720 (python)

Fixed submission:
k = int(input())
L = [1,2,3,4,5,6,7,8,9]
i = 0
while i < k:
    if int(str(L[i])[-1]) == 0:
        n2 = L[i]*10 + L[i]%10
        n3 = L[i]*10 + L[i]%10 +1
        L.append(n2)
        L.append(n3)
    elif 1 <= int(str(L[i])[-1]) <= 8:
        n1 = L[i]*10 + L[i]%10 -1
        n2 = L[i]*10 + L[i]%10
        n3 = L[i]*10 + L[i]%10 +1
        L.append(n1)
        L.append(n2)
        L.append(n3)
    elif int(str(L[i])[-1]) == 9:
        n1 = L[i]*10 + L[i]%10 -1
        n2 = L[i]*10 + L[i]%10
        L.append(n1)
        L.append(n2)
    i +=1

print(L[k-1])

Buggy submission (verdict: Runtime Error):
k = int(input())
L = []

def lunlun(d,v,L):
    L.append(v)
    if d == 4:
        return
    for i in range(-1,2):
        t = v%10 + i
        #print(v)
        if 0 <= t <=9:
            lunlun(d+1,v*10+t,L)
#lunlun(1,1,L)
for v in range(1,10):
    lunlun(1,v,L)
print(sorted(L)[k-1])
Problem p02730 (python)

Fixed submission:
s = (input())
#a,b = map(int,input().split())
n = len(s)
b = n//2
s1 = s[0:b]
s2 = s[b+1:]
#print(s1,s2)
if n == 3:
    if s[0] == s[-1]:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
        
flag1 = True
for i in range(len(s1)//2):
    if s1[i] == s1[-i-1]:
        flag1 = True
    else:
        flag1 = False
        break

if flag1 and (s1 == s2):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = (input())
#a,b = map(int,input().split())
n = len(s)
b = n//2
s1 = s[0:b]
s2 = s[b+1:]
#print(s1,s2)
for i in range(len(s1)//2):
    if s1[i] == s1[-i-1]:
        flag1 = True
    else:
        flag1 = False
        break
for i in range(len(s2)//2):
    if s2[i] == s2[-i-1]:
        flag2 = True
    else:
        flag2 = False
        break
if flag1 and flag2:
    print("Yes")
else:
    print("No")
Problem p02756 (python)

Fixed submission:
from collections import deque
s = input()
s = deque(s)
n = int(input())
cnt = False
for i in range(n):
  L = input()
  if len(L) == 1:
    cnt  ^=1 
  else:
    a,b,c = L.split()
    if cnt:
      if b == "1":
        s.append(c)
      else:
        s.appendleft(c)
    else:
      if b == "1":
        s.appendleft(c)
      else:
        s.append(c)
if cnt:
    s = reversed(s)
    print("".join(s))
else:
    print("".join(s))

Buggy submission (verdict: Runtime Error):
rom collections import deque
s = input()
n = int(input())
s = deque(s)
cnt = 0
def ap(s,a,b):
    if flag ==True:
        if a == "1":
            s.appendleft(b)
        elif a == "2":
            s.append(b)
    if flag == False:
        if a == "1": 
            s.append(b)
        elif a == "2":
            s.appendleft(b)
flag = True
for i in range(n):
    L = list(input())
    if L[0] == "1":
        flag = False
        cnt +=1
    elif L[0] == "2":
        ap(s,L[2],L[4])
        flag = True
#print(flag,cnt,s)
if cnt %2 == 1:
    s.reverse()
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
n = int(input())
import numpy as np

s = np.array(s)

L = []
for i in range(n):
    L = (list(map(str,input())))
    #print(L)
    if len(L) >1:
        if int(L[2]) == 1:
            #print(s)
            s = np.append(L[4],s)
        elif int(L[2]) == 2:
            s = np.append(s,L[4])
    
    elif len(L) ==1:
        s = np.rot90(s, 2)
        
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
n = int(input())
import numpy as np

s = np.array(s)

L = []
for i in range(n):
    L = (list(map(str,input())))
    #print(L)
    if len(L) >1:
        if int(L[2]) == 1:
            #print(s)
            s = np.append(L[4],s)
        elif int(L[2]) == 2:
            s = np.append(s,L[4])
    
    elif len(L) ==1:
        s = np.rot90(s, 2)
        
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
n = int(input())
import numpy as np
import collections
s = np.array(s)
s = collections.deque(s)
L = []
for i in range(n):
    L = (list(map(str,input())))
    #print(L)
    if len(L) >1:
        if int(L[2]) == 1:
            #print(s)
            s = np.append(L[4],s)
        elif int(L[2]) == 2:
            s = np.append(s,L[4])
    
    elif len(L) ==1:
        s = np.flipud(s)
        
print("".join(s))
Problem p02768 (python)

Fixed submission:
a,b,c = map(int,input().split())
MOD = 10**9+7

def comb(n,r):
    res = 1
    fac = 1
    for i in range(r):
        res *= n-i
        res %= MOD
        fac *= i+1
        fac %= MOD
    return res*pow(fac,MOD-2,MOD)%MOD 

p = pow(2,a,MOD)
q = comb(a,b)
r = comb(a,c)
ans = (p-q-r-1)%MOD
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
MOD=10**9+7

def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
  
print((pow(2,N,MOD)-1-comb(N,A)-comb(N,B))%MOD)
Problem p02772 (python)

Fixed submission:
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]

if all((L[i]%3 == 0 or L[i]%5 == 0 for i in range(len(L)))):

    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
        break
#print(L)
if flag:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
if flag:
    print("APPROVED")
else:
    print("DENIED")
Problem p02789 (python)

Fixed submission:
a,b = map(int,input().split())
#L = list(map(int,input().split()))
if a==b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(intinput().split())
#L = list(map(int,input().split()))
if a==b:
    print("Yes")
else:
    print("No")
Problem p02803 (python)

Fixed submission:
import collections
H,W = map(int,input().split())
if H == W == 1:
    print(0)
    exit()
if (H == 1 and W == 2) or (H == 2 and W == 1):
    print(1)
    exit()
LL=[]
for i in range(H):
    LL.append(input())

L = ((1,0),(0,1),(-1,0),(0,-1))
q = collections.deque()
max_L = []
for i in range(H):
    for j in range(W):
        d = [[0]*W for i in range(H)]
        if LL[i][j] ==".":
            q.append((i,j))
            d[i][j] = 0
            max1 = 0
            while q:
                x,y = q.popleft()
                for dx,dy in L:
                    if 0>x+dx or x+dx>H-1 or 0>y+dy or y+dy>W-1 or d[x+dx][y+dy] !=0:
                        continue
                    if  LL[x+dx][y+dy] == ".":
                        d[x+dx][y+dy] = d[x][y] +1
                        q.append((x+dx,y+dy))
                        max1 = max(max1,d[x+dx][y+dy])
                        max_L.append(max1)
                        #print(q,d ,max1)
print(max(max_L))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
L = []
for i in range(H):
    L.append(input())
import collections
q = collections.deque()
li = ((1,0),(0,1),(-1,0),(0,-1))
LL=[]

for i in range(H):
    for j in range(W):
        visited = [[-1]*W for i in range(H)]
        if L[i][j] ==".":
            visited[i][j] = 0
            q.append((i,j))
            cnt = 0
        
        while q:
            x,y = q.popleft()
            for dx,dy in li:
                nx,ny = x+dx,y+dy
                #print(nx,ny)
                if nx<0 or nx>=H or ny<0 or ny>=W or visited[nx][ny] >0:
                    continue
                if visited[nx][ny] ==-1 and  L[nx][ny] == ".": 
                    visited[nx][ny] = visited[x][y] +1
                    cnt = max(cnt,visited[nx][ny])
                    q.append((nx,ny))
                    print(q,cnt)
        LL.append(cnt)
print(max(LL))

Buggy submission (verdict: Runtime Error):
import collections
q = collections.deque()
li = ((1,0),(0,1),(-1,0),(0,-1))
LL=[]

for i in range(H):
    for j in range(W):
        visited = [[-1]*W for i in range(H)]
        if L[i][j] ==".":
            visited[i][j] = 0
            q.append((i,j))
            cnt = 0
        
        while q:
            x,y = q.popleft()
            for dx,dy in li:
                nx,ny = x+dx,y+dy
                #print(nx,ny)
                if nx<0 or nx>=H or ny<0 or ny>=W or visited[nx][ny] >0:
                    continue
                if visited[nx][ny] ==-1 and  L[nx][ny] == ".": 
                    visited[nx][ny] = visited[x][y] +1
                    cnt = max(cnt,visited[nx][ny])
                    q.append((nx,ny))
        LL.append(cnt)
print(max(LL))
Problem p02823 (python)

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

if (b-a)%2 == 0:
    print((b-a)//2)
    exit()

print(min(b,n-a+1,a+(b-a)//2,n-b+1 + (b-a-1)//2) )

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if (b-a)%2 == 0:
  print(min(b-a)//2,n-a,b-1))
else:
  print(min(n-a,b-1))
Problem p02830 (python)

Fixed submission:
n = int(input())
s1,s2 = map(str,input().split())

s = ""
#a,b = map(int,input())
#L = list(map(int,input().split()))
for i in range(n):
    s += s1[i]+s2[i]
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s1 = input()
s2 = input()
ans = ""
for i in range(n):
  ans += s1[i]+s2[i]
print(ans)
Problem p02853 (python)

Fixed submission:
x,y = map(int,input().split())
if x + y == 2:
  print(1000000)
elif x + y == 3:
  print(500000)
elif x + y == 5:
  print(300000)
elif x + y == 4:
  print(400000)
elif x + y == 6:
  print(200000)
elif x + y >=5 and min(x,y) == 1:
  print(300000)
elif x + y >=5 and min(x,y) == 2:
  print(200000)
elif x + y >=5 and min(x,y) == 3:
  print(100000)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x + y == 2:
  print(100000)
elif x + y == 3:
  print(50000)
elif x + Y == 5:
  print(30000)
elif x + Y == 4:
  print(40000)
elif x + Y == 6:
  print(20000)
else:
  print(0)
Problem p02888 (python)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
li.sort()

num = 0
import bisect
for i in range(n):
    for j in range(i+1,n):
        num += bisect.bisect_left(li,li[i]+li[j])-(j+1)
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
#a,b = map(int,input().split())
li = list(map(int,input().split()))
li.sort()
#print(li)
num = 0

for i in range(n-4):
    if li[i] == li[i+1] ==li[i+2] == li[i+3]:
        li.pop(li[i+3])
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if li[i]+li[j]>li[k] and li[i]<li[j]+li[k] and li[i]+li[k]>li[j]:
                num += 1
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
#a,b = map(int,input().split())
li = list(map(int,input().split()))
li.sort()
#print(li)
num = 0

for i in range(n-4):
    if li[i] == li[i+1] ==li[i+2] == li[i+3]:
        li.pop(li[i+3])
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if li[i]+li[j]>li[k] and li[i]<li[j]+li[k] and li[i]+li[k]>li[j]:
                num += 1
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
#a,b = map(int,input().split())
li = list(map(int,input().split()))
li.sort()
#print(li)
num = 0

for i in range(n-4):
    if li[i] == li[i+1] ==li[i+2] == li[i+3]:
        li.pop(li[i])
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if li[i]+li[j]>li[k] and li[i]<li[j]+li[k] and li[i]+li[k]>li[j]:
                num += 1
print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
#a,b = map(int,input().split())
li = list(map(int,input().split()))
li.sort()
#print(li)
num = 0

for i in range(n-4):
    if li[i] == li[i+1] ==li[i+2] == li[i+3]:
        li.remove(li[i])
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if li[i]+li[j]>li[k] and li[i]<li[j]+li[k] and li[i]+li[k]>li[j]:
                num += 1
print(num)
Problem p02936 (python)

Fixed submission:
from collections import deque
n,q = map(int,input().split())
ki = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
score = [0 for i in range(n)]

for i in range(q):
    p,x = map(int,input().split()) 
    score[p-1] += x

#print(ki,score)
ans = [0 for i in range(n)]

ans[0] = score[0]
visited = [False]*n
visited[0] = True
Q = deque([0])

while Q:
    d = Q.pop()
    #print(d)
    for to in ki[d]:
        if visited[to]:
            continue
        
        ans[to] = ans[d] + score[to]
        #print(ans[to],ans[d],score[to],d)
        visited[to] = True
        Q.append(to)
print(*ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
n,q = map(int,input().split())
ki = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
score = [0]*n

for i in range(q):
    p,x = map(int,input().split()) 
    score[p-1] += x
#print(ki,score)
ans = [0]*n

def dfs(v,p,value): #p:parent of v
    value +=score(v)
    #print(score[v],value)
    ans[v] = value
    for i in ki[v]:
        if i == p:
            continue
        dfs(i,v,value)
dfs(0,-1,0)

print(*ans)
Problem p02945 (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))

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

Fixed submission:
k,x = map(int,input().split())
a = x - k + 1
b = x + k - 1

for i in range(a,b+1):
    print(i,end = " ")

Buggy submission (verdict: Runtime Error):
k,x = map(int,input())
min1 = x-k+1
max1 = x+k-1
L = []
for i in range(min1,max1+1):
  L.append(i)
print(*L)

Buggy submission (verdict: Runtime Error):
k,x = map(int,iinput().split))
for i in range(x-k+1,x+k):
  print(i)