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

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

L, R = map(int, input().split())
if (R - L) > 3000:
    print(0)
    exit()
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            ans = min(ans, (i * j) % 2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

import numpy as np

L, R = map(int, input().split())
if (L - R) > 2020:
    print(0)
    exit()
else:
    k = np.arange(L, R + 1, dtype=np.int64)
    k = k % 2019
    k = sorted(k)
    print(k[0] * k[1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

import numpy as np

L, R = map(int, input().split())
if (L - R) > 2019:
    k = np.arange(L, L + 2019, dtype=np.int64)
else:
    k = np.arange(L, R + 1, dtype=np.int64)

k = k % 2019
print(k[0] * k[1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

import numpy as np

INF = float('inf')
NIL = - 1

L, R = map(int, input().split())
k = np.arange(L, R + 1, dtype=np.int64)
k = k % 2019
print(k[0] * k[1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

import numpy as np

L, R = map(int, input().split())
k = np.arange(L, R + 1, dtype=np.int64)
k = k % 2019
# print(k)
# print(sorted(k))
print(k[0] * k[1])









# def main():

# if __name__ == '__main__':
#     main()
Problem p02995 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

def gcd(a, b):
    """
    Greatest Common Divisor
    Euclidean Algortihm
    """
    if a < b:
        gcd(b, a)
    while b != 0:
        a, b = b, a % b
    return a

INF = float('inf')
NIL = - 1


def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())
total = B - A + 1

if A % C != 0:
    c_count = (B // C) - (A // C)
else:
    c_count = (B // C) - (A // C) + 1

if A % D != 0:
    d_count = (B // D) - (A // D)
else:
    d_count = (B // D) - (A // D) + 1


lcm = lcm(C, D)
if A % lcm != 0:
    lcm_count = (B // lcm) - (A // lcm)
else:
    lcm_count = (B // lcm) - (A // lcm) + 1


print(total - c_count - d_count + lcm_count)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop
from math import gcd

INF = float('inf')
NIL = - 1


def lcm(x, y):
    return (x * y) // gcd(x, y)


A, B, C, D = map(int, input().split())
total = B - A + 1

if A % C != 0:
    c_count = (B // C) - (A // C)
else:
    c_count = (B // C) - (A // C) + 1

if A % D != 0:
    d_count = (B // D) - (A // D)
else:
    d_count = (B // D) - (A // D) + 1


lcm = lcm(C, D)
if A % lcm != 0:
    lcm_count = (B // lcm) - (A // lcm)
else:
    lcm_count = (B // lcm) - (A // lcm) + 1


print(total - c_count - d_count + lcm_count)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
import math
 
n=int(input())
ls=[int(s) for s in input().split(" ")]
 
if 0 in ls:
  print(0)
else:
  num=0
  for i in ls:
    num+=math.log10(i)
 
  if num <= 18:
    print(int(round(10**num,5)))
  else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(a*b)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(a*b)
Problem p02747 (python)

Fixed submission:
S = input()
S_len = len(S)
if S_len % 2 != 0:
    print("No")
else:
    set_num = int(S_len // 2)
    for i in range(set_num):
        if S[i*2] != "h" or S[i*2 +1] != "i":
            hitachi = False
            break
        else:
            hitachi = True
    if hitachi == False:
        print("No")
    elif hitachi  == True:
        print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
S_len = len(S)
if S_len % 2 != 0:
    print("No")
else:
    set_num = int(S_len // 2)
    for i in range(set_num):
        if S[i*2] != "h" or S[i*2 +1] != "i":
            hitachi? = False
            break
        else:
            hitachi? = True
    if hitachi? = False:
        print("No")
    elif hitachi? = True:
        print("Yes")
Problem p03379 (python)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
xsort = sorted(x)
x1, x2 = xsort[n//2-1], xsort[n//2]

for i in range(n):
    if x[i] <= x1:
        print(x2)
    else:
        print(x1)

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

n = int(input())
x = deque(map(int, input().split()))

for i in range(0, len(x)):
    x_copy = x.copy()
    del x_copy[i]
    print(median(x_copy))
Problem p02981 (python)

Fixed submission:
N,A,B=map(int,input().split())
print(min(N*A,B))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
lll=L//673
rrr=R//673
if l<r or ll==0:
  print(0)
elif lll>=1 and R-L>=3:
  print(0)
else:
  print(ll*(ll+1))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
if l<r or ll==0:
  print(0)
else:
  print(ll*(ll+1))
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
if R - L >= 2018:
	print(0)
else:
	ans = 2019
	for i in range(L, R):
		for j in range(i + 1, R + 1):
			ans = min(ans, i * j % 2019)
	print(ans)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
rr=R%2019
Ans=[]
if R-L>=2019:
  print(0)
else:
  if R==L+1:
    Ans.append(R*L%2019)
  else:
    for i in range(R,L+1):
      for j in range(R+1,L+1):
        Ans.append(i*j%2019)
print(min(Ans))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
if l<r or ll==0 or :
  print(0)
else:
  print(ll*(ll+1))
Problem p02993 (python)

Fixed submission:
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
elif N+L=0:
  print(sum(LL))
else:
  print(sum(LL)-min(LLL))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
else:
  print(sum(LL)-min(LLL))
Problem p02994 (python)

Fixed submission:
N,L=map(int,input().split()) 
LL=[L+i for i in range(N)]
if L>=1:
  print(sum(LL)-min(LL))
elif N+L>0:
  print(sum(LL))
else:
  print(sum(LL)-max(LL))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
elif N+L=0:
  print(sum(LL))
else:
  print(sum(LL)-min(LLL))
Problem p02999 (python)

Fixed submission:
X,A=map(int,input().split())
if X < A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
L.append(0)
L.sort()
for i in range(N+1):
  if sum(L[:i+1]) > X:
    print(i)
    break
  elif sum(L) =<X:
    print(N)
    break
Problem p03023 (python)

Fixed submission:
a=int(input())
print(a*180-360)

Buggy submission (verdict: Runtime Error):
print((int(input()-1)*90)
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
a=[]
b=[]
for i in range(A):
  if A%(i+1) == 0:
    a.append(i+1)
for ii in range(B):
  if B%(ii+1) == 0:
    b.append(ii+1)
s=set(a)&set(b)
print(sorted(list(s))[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=[]
b=[]
for i in range(A):
  if A%(i+1) == 0:
    a.append(i+1)
for ii in range(B):
  if B%(ii+1) == 0:
    b.append(ii+1)
s=set(a)&set(b)
print(sorted(list(s))[K])
Problem p03110 (python)

Fixed submission:
N=int(input())
l=[]
for i in range(N):
  d,t=input().split()
  l.append([d,t])
m=0
for i in l:
  if i[1] == "JPY":
    m=m+int(i[0])
  else:
    m=m+380000.0*float(i[0])
print(m)

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(N):
  l=list(input().split)
print(l)
Problem p03206 (python)

Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
ans=[]
for i in range(len(h)-K+1):
  b=h[K+1-i]-h[i]
  ans.append(b)
print(min(b))

Buggy submission (verdict: Runtime Error):
import itertools
N,K=map(int,input().split())
L=[]
for l in range(N):
  L.append(int(input()))
ans=[]
for r in list(itertools.combinations(L,K)):
  ans.append(max(r)-min(r))
print(min(ans))

Buggy submission (verdict: Runtime Error):
print("Christmas"+25-int(input())*" Eve")
Problem p03210 (python)

Fixed submission:
a=int(input())
if(a==7 or a==5 or a==3):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
if input() == "7" or input() == "5" or input() == "3":
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
if input() == 7 or input() == 5 or input() == 3:
  print("YES")
else:
  print("NO")
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
if input()=="1":
  print("Hello World")
else:
  print(int(input)+int(input))
Problem p03244 (python)

Fixed submission:
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = n - e[1][1] - o[0][1]
        b = n - e[0][1] - o[1][1]
        print(min(a, b))

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = n - e[1][1] - o[0][1]
        b = n - e[0][1] - o[1][1]
        print(min(a, b))

Buggy submission (verdict: Runtime Error):
import itertools
N=int(input())
L=list(map(int,input().split()))
data=list(set(L))
S=list(itertools.permutations(data, 2))
ans=[]
for s in S:
  p=0
  for i in range(N):
    if i%2==0:
      if s[0]==L[i]:
        p=p
      else:
        p=p+1
    else:
      if s[1]==L[i]:
        p=p
      else:
        p=p+1
  ans.append(p)
print(min(ans))
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2==1 and b%2==1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2==0 or b%==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().splite())
if a%2==0 or b%==0:
  print("Yes")
else:
  print("No")
Problem p03261 (python)

Fixed submission:
N=int(input())
L=[]
for i in range(N):
  L.append(input())
if not len(set(L))==len(L):
  print("No")
else:
  for n in range(N):
    if n==(N-1):
      print("Yes")
    elif L[n][-1] == L[n+1][0]:
      continue
    else:
      print("No")
      break

Buggy submission (verdict: Runtime Error):
L=[]
for i in range(N):
  L.append(input())
if not len(L)==len(set(L)):
  print("NO")
n=0
while n<=N:
  if n==N-1:
    print("Yes")
    break
  elif L[n][-1]==L[n+1][0]:
    n=n+1
  else:
    print("NO")
    break
Problem p03308 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(max(A)-min(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input.split))
print(max(A)-min(A))
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>8 or b8:
  print(":(")
else:
  print("Yay!")
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(c-a)>d:
  if abs(a-b)>d or abs(b-c)>d:
    print("No")
  else:
    print("Yes")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if c-a > 2d:
  print("No")
else:
  print("Yes")
Problem p03377 (python)

Fixed submission:
A,B,X=map(int,input().split())
if A>X:
  print("NO")
elif A+B<X:
  print("NO")
else:
  print("YES")

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
if a >= x:
  print("NO")
elif a+b <= x:
  print("NO")
else:
  print(YES)
Problem p03385 (python)

Fixed submission:
S=input()
S=set(S)
if len(S)==3:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if sort.(input()) =="abc":
  print("yes")
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
 
X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=list(range(A,B+1))
e=a[:K]
f=a[:-K-1:-1]
g=list(set(e+f))
g.sort()
for i in g :
  print(i)

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
a=list(range(A,B))
b=set(a[:K]+(a[:K:-1]))
for i in b:
  print(i)
Problem p03407 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b < c:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().splite())
if a+b < c:
  print("No")
else:
  print("Yes")
Problem p03415 (python)

Fixed submission:
a=""
for i in range(3):
  l=input().split()
  a=a+l[0][i]
print(a)

Buggy submission (verdict: Runtime Error):
a=""
for i in range(3):
  l=input().split()
  a=a+l[i]
print(a)
Problem p03463 (python)

Fixed submission:
N,A,B=map(int,input().split())
if (A-B)%2==0:
  print("Alice")
else:
  print("Borys")

Buggy submission (verdict: Runtime Error):
N,A,B=map(input().split())
if A-B%2==0:
  print("Alice")
else:
  print("Borys")
Problem p03471 (python)

Fixed submission:
N,Y=map(int,input().split())

L=[[h,i,N-h-i]for h in range(N+1) for i in range(N+1) if h*1000+i*5000+(N-h-i)*10000==Y and (N-h-i)>=0]

if len(L)>0:
  print(L[0][2],end=" ")
  print(L[0][1],end=" ")  
  print(L[0][0])
else:
  print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import numpy as np
N,T=map(int,input().split())
D=[ [x,y,z,x+y+z,10000*x+5000*y+1000*z] for x in range(N+1) for y in range(N+1)for z in range(N+1)]
D=np.array(D)
index = np.where(D[:, -1] == T)
DD=D[index]
ans = np.where(DD[:, -2] == N)
if len(DD[ans])==0:
  print("-1 -1 -1")
else:
  print(str(DD[ans][0][0])+" "+str(DD[ans][0][1])+" "+str(DD[ans][0][2]))
Problem p03607 (python)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))

Buggy submission (verdict: Runtime Error):
N=int(input())
L=[]
n=0
while n <N+1 :
  A=int(input())
  if A in L:
    L.remove(A)
    n=n+1
  else:
    L.append(A)
    n=n+1
print(len(L))
Problem p03694 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
print(max(L)-min(L))

Buggy submission (verdict: Runtime Error):
N=int(input)
L-list(map(int,input().split()))
print(max(L)-min(L))
Problem p02921 (python)

Fixed submission:
s=list(input())
t=list(input())
ans=0
for i in range(len(s)):
  if s[i]==t[i]:
    ans+=1
    continue
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=list(map(int,input().split()))
if b//a==0:
  print(b//a)
elif -(-b//a):
  print(-(-b//a))
Problem p03369 (python)

Fixed submission:
s=input()
print(700+100*int(s.count("o")))

Buggy submission (verdict: Runtime Error):
s=input()
print(700+100*int(s.coount("o")))
Problem p03597 (python)

Fixed submission:
N=int(input())
A=int(input())
black_cell=N**2-A
print(black_cell)

Buggy submission (verdict: Runtime Error):
N=iintnt(input())
A=int(input())
black_cell=N**2-A
print(black_cell)
Problem p02767 (python)

Fixed submission:
from statistics import mean
def main():
    N = int(input())
    X = list(map(int, input().split()))
    P = int(mean(X) + 0.5)
    d = 0
    for n in range(N):
        d += (X[n] - P)**2
    print(d)
 
main()

Buggy submission (verdict: Runtime Error):
from statistics import mean
def main():
    N = int(input())
    X = list(map(int, input().split()))
    P = int(mean(X) + 0.5)
    d = 0
    for n in range(N):
        d += (X[n] - P)**2
    print(d)

main()
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
print(H // A + (H % A > 0))

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
x = [list(map(int, input().split())) for n in range(N)]
x = [[tmp[i] for tmp in x] for i in range(len(x[0]))]
A = x[0]
B = x[1]

def ibis(H, A, B):
    maxA = max(A)
    HmaxA = H + maxA
    minB = min(B)
    dp = [max(B) * H] * (HmaxA + 1)
    dp[0] = 0
    for h in range(HmaxA):
        for n in range(N):
            dp[h + 1] = min(dp[h + 1], dp[h] + minB)
            hp = h + A[n]
            if hp <= HmaxA:
                dp[hp] = min(dp[hp], dp[h] + B[n])
    return min(dp[H:HmaxA+1])

print(ibis(H, A, B))
Problem p02657 (python)

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

c = a * b

print(c)

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

a * b = c

print(c)
Problem p02882 (python)

Fixed submission:
from math import atan,pi
a,b,x=map(int,input().split())
if a**2*b>=2*x:
    try:
        print(90-atan(2*x/(a*b**2))*180/pi)
    except: print(0)
else:
    try:
        print(90-atan(a**3/(2*a**2*b-2*x))*180/pi)
    except: print(0)

Buggy submission (verdict: Runtime Error):
from math import atan,pi
a,b,x=map(int,input().split())
if a**2*b>=2*x:
    print(90-atan(2*x/(a*b**2))*180/pi)
else:
    print(90-atan(a**3/(2*a**2*b-2*x))*180/pi)
Problem p02947 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=i*(i-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

factmemo={0:1} #階乗
def fact(n):
    if n in factmemo:
        return factmemo[n]
    k = n*fact(n-1)
    factmemo[n]=k
    return k

def comb(a,b): return fact(a)//(fact(a-b)*fact(b)) #組み合わせ


n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=comb(i,2)
print(ans)
Problem p02958 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
input=sys.stdin.readline
def intinput():return map(int,input().split())


n=int(input())
a=list(intinput())
b=a[:]
b.sort()
if a == b:
    print("YES")
    sys.exit()
for i in range(n):
    for j in range(i+1,n):
        a[i],a[j]=a[j],a[i]
        if a==b:
            print("YES")
            sys.exit()
        a[i],a[j]=a[j],a[i]
print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  for j in range(i+1,n):
    a[i],a[j]=a[j],a[i]
    for k in range(n-1):
      if a[k]>a[k+1]:
        a[i],a[j]=a[j],a[i]
        break
    else:
      i,j=n,n
if i==n:
  print("YES")
else:
  print("NO")
Problem p03006 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())


n=int(input())
p=[]
for _ in range(n):
    p.append(tuple(intinput()))
s={}
for x,y in p:
    for x1,y1 in p:
        if x==x1 and y==y1:
            continue
        if (x-x1,y-y1) in s:
            s[(x-x1,y-y1)]+=1
        else:
            s[(x-x1,y-y1)]=1
if n==1:
    print(1)
else:
    print(n-max(s.values()))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())


n=int(input())
p=[]
for _ in range(n):
    p.append(tuple(intinput()))
s={}
for x,y in p:
    for x1,y1 in p:
        if x==x1 and y==y1:
            break
        if (x-x1,y-y1) in s:
            s[(x-x1,y-y1)]+=1
        else:
            s[(x-x1,y-y1)]=1
print(n-max(s.values()))
Problem p02657 (python)

Fixed submission:
val_1 = input()
nums = val_1.split()
mult = int(nums[0]) * int(nums[1])
print(mult)

Buggy submission (verdict: Runtime Error):
n = int(input())
values = input().split()

mult = 1
for i in range(len(values)):
  mult *= int(values[i])
  
if mult > 10**18:
  print(-1)
else:
  print(mult)
Problem p02658 (python)

Fixed submission:
def main():
  n = int(input())
  values = list(map(int, input().split()))
  if 0 in values:
    print(0)
    return

  mult = 1
  for i in values:
    mult *= i
    if mult > 1000000000000000000:
      print(-1)
      return
  print(mult)

main()

Buggy submission (verdict: Runtime Error):
n = int(input())
values = list(map(int, input().split()))
if 0 in values:
  print(0)
  return

mult = 1
for i in values:
  mult *= i
  if mult > 1000000000000000000:
    print(-1)
    return

print(mult)

Buggy submission (verdict: Runtime Error):
def main ():
  n = int(input())
  values = list(map(int, input().split()))
  if 0 in values:
    print(0)
    return
  
  mult = 1
  for i in values:
    mult *= i
    if mult > 10**18:
      print(-1)
      return
    
    print(prod)
    
main ()

Buggy submission (verdict: Runtime Error):
import psyco
psyco.full()

n = int(input())
values = input().split()
mult = 1

for i in range(len(values)):
  mult *= int(values[i])
  if mult > 10**18:
    mult = -1
    break
    
print(mult)