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

Fixed submission:
import collections
h, w = map(int, input().split())
queue = collections.deque()
maze = [list(input()) for _ in range(h)]

origin = 0
for i in maze:
    origin += i.count('#')
# print(origin)


def bfs(y, x, cnt):
    if (y < 0 or h <= y or x < 0 or w <= x):
        return
    if (maze[y][x] != '.'):
        return
    maze[y][x] = cnt
    if (y == h - 1 and x == w - 1):
        return cnt
    queue.append([y + 1, x, cnt + 1])
    queue.append([y - 1, x, cnt + 1])
    queue.append([y, x+1, cnt+1])
    queue.append([y, x-1, cnt+1])


queue.append([0, 0, 0])
while (len(queue) > 0):
    l = queue.popleft()
    bfs(l[0], l[1], l[2])
if (maze[h - 1][w - 1] == '.'):
    print(-1)
    exit()

# print(ans)
print(h*w-origin-maze[h-1][w-1]-1)

Buggy submission (verdict: Runtime Error):
import collections
h, w = map(int, input().split())
queue = collections.deque()
maze = [list(input()) for _ in range(h)]

origin = 0
for i in maze:
    origin += i.count('#')
# print(origin)


def bfs(y, x, cnt):
    if (y < 0 or h <= y or x < 0 or w <= x):
        return
    if (maze[y][x] != '.'):
        return
    maze[y][x] = cnt
    if (y == h - 1 and x == w - 1):
        return cnt
    queue.append([y + 1, x, cnt + 1])
    queue.append([y - 1, x, cnt + 1])
    queue.append([y, x+1, cnt+1])
    queue.append([y, x-1, cnt+1])


queue.append([0, 0, 0])
while (len(queue) > 0):
    l = queue.popleft()
    bfs(l[0], l[1], l[2])

# print(ans)
print(h*w-origin-maze[h-1][w-1]-1)
Problem p03579 (python)

Fixed submission:
import math
import sys
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
color = [-1]*n
edge = [list() for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

flag = True


def dfs(i, pre, c):
    if color[i] == c:
        return
    elif color[i] == 1-c:
        global flag
        flag = False
        return
    color[i] = c
    for v in edge[i]:
        dfs(v, i, 1-c)


dfs(0, -1, 0)
# print(color)
# print(flag)

if flag:
    print(color.count(1)*color.count(0)-m)
else:
    print(math.floor(n*(n-1)/2-m))

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
color = [-1]*n
edge = [list() for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

flag = True


def dfs(i, pre, c):
    if color[i] == c:
        return
    elif color[i] == 1-c:
        global flag
        flag = False
        return
    color[i] = c
    for v in edge[i]:
        dfs(v, i, 1-c)


dfs(0, -1, 0)
# print(color)
# print(flag)

if flag:
    print(color.count(1)*color.count(0)-m)
else:
    print(math.floor(n*(n-1)/2-m))
Problem p03612 (python)

Fixed submission:
# ABC072d
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(n):
    if p[i] == i+1:
        if i == n-1:
            ans += 1
            continue
        t = p[i]
        p[i] = p[i+1]
        p[i+1] = t
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# ABC072d
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(n):
    if p[i] == i+1:
        t = p[i]
        p[i] = p[i+1]
        p[i+1] = t
        ans += 1
print(ans)
Problem p03633 (python)

Fixed submission:
# ABC070c
from fractions import gcd
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())


def lcm_base(a, b):
    return a * b // gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def gcds(*numbers):
    return reduce(gcd, numbers)


t = [int(input()) for _ in range(n)]
print(lcm(*t))

Buggy submission (verdict: Runtime Error):
# ABC070c
from fractions import gcd
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())


def lcm_base(a, b):
    return a * b // fractions.gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


t = [int(input()) for _ in range(n)]
print(lcm(*t))

Buggy submission (verdict: Runtime Error):
# ABC070c
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())


def lcm_base(a, b):
    return a * b // math.gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


t = [int(input()) for _ in range(n)]
print(lcm(*t))
Problem p03651 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
#from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))

if k > max(a):
    print('IMPOSSIBLE')
    exit(0)
if k in a:
    print('POSSIBLE')
    exit(0)


def gcds(*numbers):
    return reduce(gcd, numbers)


if k % gcds(*a) == 0:
    print('POSSIBLE')
    exit(0)
print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
#from fractions import gcd
from functools import reduce
from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))

if k > max(a):
    print('IMPOSSIBLE')
    exit(0)
if k in a:
    print('POSSIBLE')
    exit(0)


def gcds(*numbers):
    return reduce(gcd, numbers)


if k % gcds(*a) == 0:
    print('POSSIBLE')
    exit(0)
print('IMPOSSIBLE')
Problem p03711 (python)

Fixed submission:
# ABC062a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


# Union-Find木


class UnionFind:
    def __init__(self, n):
        self.tree = [i for i in range(n)]

    def root(self, x):
        if(self.tree[x] == x):
            return x
        self.tree[x] = self.root(self.tree[x])
        return self.tree[x]  # 経路圧縮

    def same(self, x, y):  # xとyが同じ木に属するか
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if(x == y):
            return
        self.tree[x] = y


uf = UnionFind(12)
uf.unite(0, 2)
uf.unite(0, 4)
uf.unite(0, 6)
uf.unite(0, 7)
uf.unite(0, 9)
uf.unite(0, 11)
uf.unite(3, 5)
uf.unite(3, 8)
uf.unite(3, 10)

x, y = map(int, input().split())
print('YNeos'[not uf.same(x-1, y-1)::2])

Buggy submission (verdict: Runtime Error):
# ABC062a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


# Union-Find木


class UnionFind:
    def __init__(self, n):
        self.tree = [i for i in range(n)]

    def root(self, x):
        if(self.tree[x] == x):
            return x
        self.tree[x] = self.root(self.tree[x])
        return self.tree[x]  # 経路圧縮

    def same(self, x, y):  # xとyが同じ木に属するか
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if(x == y):
            return
        self.tree[x] = y


uf = UnionFind(12)
uf.unite(0, 2)
uf.unite(0, 4)
uf.unite(0, 6)
uf.unite(0, 7)
uf.unite(0, 9)
uf.unite(0, 11)
uf.unite(3, 5)
uf.unite(3, 8)
uf.unite(3, 10)

print('YNeos'[uf.same(*tuple(map(int, input().split())))::2])
Problem p03730 (python)

Fixed submission:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

for i in range(a, a * b+a, a):
    if (i % b == c):
        #print(i, b, i % b, c)
        print('YES')
        exit()
print('NO')

Buggy submission (verdict: Runtime Error):
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

if c % math.gcd(a, b) == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

print('YES' if c % math.gcd(a, b) == 0 else 'NO')
Problem p02787 (python)

Fixed submission:
HN = list(map(int, input().split()))
H = HN[0]; N = HN[1]
AB = [list(map(int, input().split())) for _ in range(N)]
 
DP = [[0]*H for i in range(N)]
 
for i in range(H):
    DP[0][i] = int((1+i//AB[0][0])*AB[0][1])
 
for i in range(1,N):
    for j in range(H):
        if j<AB[i][0]:
            DP[i][j] = int(min([DP[i-1][j], AB[i][1]]))
        else:
            DP[i][j] = min([DP[i-1][j], DP[i][j-AB[i][0]] + AB[i][1]])
 
print(int(DP[N-1][H-1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
 
HN = list(map(int, input().split()))
H = HN[0]; N = HN[1]
AB = [list(map(int, input().split())) for _ in range(N)]
 
DP = np.zeros((N,H))
 
for i in range(H):
    DP[0][i] = int((1+i//AB[0][0])*AB[0][1])
 
for i in range(1,N):
    for j in range(H):
        if j<AB[i][0]:
            DP[i][j] = int(min([DP[i-1][j], AB[i][1]]))
        else:
            DP[i][j] = min([DP[i-1][j], DP[i][j-AB[i][0]] + AB[i][1]])
 
print(int(DP[N-1][H-1]))
Problem p02657 (python)

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

print(a*b)

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

a = int(a)

b1,b2 = map(int, b.split('.'))
b = b1*100 + b2

ans = (a*b)//100

print(int(ans))
Problem p02705 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 13:36:36 2020

@author: hiroki
"""

import math

a = input()
print(int(a)*2*math.pi)

Buggy submission (verdict: Runtime Error):
import numpy as np

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

sub = np.bincount(A, weights=None, minlength=N+1)

for i in range(N):
    print(sub[i+1])

Buggy submission (verdict: Runtime Error):

import numpy as np

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

sub = np.bincount(A, weights=None, minlength=N+1)
sub1 = sub.reshape(N+1, 1)

print(sub1[1:])
Problem p02677 (python)

Fixed submission:
import numpy as np
a,b,h,m=map(int,input().split())
pi=np.pi
h_deg=(1/6)*pi*h+(1/360)*pi*m
m_deg=(1/30)*pi*m
deg=abs(m_deg-h_deg)
if(deg>pi):
    deg=2*pi-deg
else:
    pass
c=a**2+b**2-2*a*b*np.cos(deg)
print(c**(1/2))

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b,h,m=map(float,input().split())
pi=np.pi
h_deg=(1/6)*pi*h
m_deg=(1/30)*pi*m
deg=abs(m_deg-h_deg)
if(deg>pi):
    deg=2*pi-deg
else:
    pass
c=a**2+b**2-2*a*b*np.cos(deg)
print(c**(1/2))
print(deg/pi)
Problem p02789 (python)

Fixed submission:
hoge = input()
tmp = hoge.split()

if tmp[0] == tmp[1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
hoge = [input() for i in range(2)]
tmp = hoge[1].split()
num = int(hoge[0])

tmp = list(map(int,tmp))

flag = 1
count = 0
j = 1
for i in range(num):
    now_list = tmp[:j]
    if len(now_list) == len([None for piyo in now_list if piyo >= now_list[-1]]):
        count += 1

    j += 1

print(count)
Problem p03071 (python)

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

count = 0

if a > b :
  count += a
  a -= 1
else:
  count += b
  b -= 1

if a > b :
  count += a
  a -= 1
else:
  count += b
  b -= 1
  
print(count)

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

count = 0

if a > b :
  count += a
  a -= 1
else:
  count += b
  b -= 1
  
if a > b :
  count += a
  a -= 1
else:
  count += b
  b -= 1
  
print(count)
Problem p03261 (python)

Fixed submission:
N = int(input())
ketu = ""
mozi = []
frag = 0
for i in range(N):
    stri = input()
    if (ketu != "" )and(ketu != stri[0]):
        frag = 1

    ketu = stri[-1]
    mozi.append(stri)

if frag == 1:
    print("No")
    exit()

if len(mozi) != len(list(set(mozi))):
    print("No")
    exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
W = []
jud = 1

for _ in range(N):
    W.append(input())

c = collections.Counter(W)
ct = len(c)

for i in range(N-1):
    fst = W[i]
    fnl = W[i+1]
    if fst[-1] != fnl[1]:
        jud = 0

if ct != N:
    print("No")
elif jud == 0:
    print("No")
else: print("Yes")

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
W = []
jud = 1

for _ in range(N):
    W.append(input())

c = collections.Counter(W)
ct = len(c)

for i in range(N-1):
    fst = W[i]
    fnl = W[i+1]
    if fst[-1] == fnl[1]:
        jud = 0

if ct != N:
    print("No")
elif jud == 0:
    print("No")
else: print("Yes")
Problem p03592 (python)

Fixed submission:
n,m,k= input().split()

n = int(n)
m = int(m)
k = int(k)

for i in range(n+1):
    for j in range(m+1):
        if k == (i*(m-j) + (n-i)*j) :
            print("Yes")
            exit()


print("No")

Buggy submission (verdict: Runtime Error):
n,m,k= input().split()

n = int(n)
m = int(m)
k = int(k)

for i in range(n+1):
  for j in range(m+1):
	if i*(m-j) + (n-i)j == k:
      print("Yes")
      exit()


print("No")
Problem p02687 (python)

Fixed submission:
a =input()
if a == "ABC":
  print("ARC")
elif a =="ARC":
  print("ABC")

Buggy submission (verdict: Runtime Error):
NM=list(map(int,input().split()))
person=[0 for i in range(NM[0])]
for i in range(NM[1]):
    d=input() 
    snack=list(map(int,input().split()))
    for i in snack:
        person[i-1]=1
d=0
for i in range(len(person)):
    if person[i]==0:
        d+=1
print(d)
Problem p02690 (python)

Fixed submission:
def func(x):
    for A in range(-118,120):
        for B in range(-119,119):
            if (A**5-B**5)==x:
                return A,B

def main():
    x=int(input())
    print("%d %d" %func(x))
                

if __name__=="__main__":
    main()

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

void solve(){
  int X;
  int A,B;
  cin >> X ;
  for (A=-118;A<120;A++){
    for (B=-119;B<A;B++){
      if (pow(A,5.0)-pow(B,5.0)==X){
	cout << A << B << endl;
	goto OUT;
      }
    }
  }
 OUT:;
}

int main(){
  solve();
  return 0;
}
Problem p02646 (python)

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

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input())

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*v - T*w
    if (k <= l):
        flag = True


if (flag == True):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input())

k = b - a
l = b*w + a*w

if (k < l):
    flag = False

if (flag):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input()

k = b - a
l = bw + aw

if (k < l):
    flag = False

if (flag):
    print('YES')
else:
    print('NO')
Problem p02731 (python)

Fixed submission:
L = int(input())

x=y=z=0

x=y=z=L/3

V = x*y*z




print(V)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

from decimal import *
import numpy as np


getcontext().prec = 6

L = int(input())
L = Decimal(L)

x=y=z=0
x = Decimal(x)
y = Decimal(y)
z = Decimal(z)


p = 0.01
p = Decimal(p)

maxV = 0

for x in np.arange(p,L+1,p):
    for y in np.arange(p,L+1,p):
        z = L-(x+y)

        V = x*y*z
    
        if maxV < V:
            maxV = V


print(maxV)
Problem p03244 (python)

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

from collections import defaultdict

#入力   
n = int(input())
v = tuple(int(i) for i in input().split())

def f(v):
    d = defaultdict(int)
    d[0] = 0

    for i in v:
        d[i] += 1
    return sorted(d.items(), key=lambda x: x[1], reverse=True)

t1 = f(v[::2])
t2 = f(v[1::2])

if t1[0][0] == t2[0][0]:
    if t1[0][1] + t2[1][1] > t1[1][1] + t2[0][1]:
        print(n - t1[0][1] - t2[1][1])
    else:
        print(n - t1[1][1] - t2[0][1])
else:
    print(n - t1[0][1] - t2[0][1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

from collections import defaultdict

#入力   
n = int(input())
v = list(int, input().split())

def f(v):
    d = defaultdict(int)
    d[0] = 0

    for i in v:
        d[i] += 1
    return sorted(d.items(), key=lambda x: x[1], reverse=True)

t1 = f(v[::2])
t2 = f(v[1::2])

if t1[0][0] == t2[0][0]:
    if t1[0][1] + t2[1][1] > t1[1][1] + t2[0][1]:
        print(n - t1[0][1] - t2[1][1])
    else:
        print(n - t1[1][1] - t2[0][1])
else:
    print(n - t1[0][1] - t2[0][1])
Problem p02631 (python)

Fixed submission:
from functools import reduce

n = int(input())
a = tuple(map(int, input().split()))

res = reduce(lambda x, y: x ^ y, a)
ans = [res ^ i for i in a]
print(*ans)

Buggy submission (verdict: Runtime Error):
def main():
    _ = int(input())
    a = tuple(map(int, input().split()))

    res = 0
    for i in a:
        res ^= i
    ans = [res ^ j for j in a]
    for k in ans:
        print(ans)


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

Fixed submission:
import collections

n = int(input())


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


ans = 0
if n > 1:
    tmp = collections.Counter(prime_factorize(n))
    for v in tmp.values():
        i = 1
        while v > 0:
            if v - i >= 0:
                v -= i
                ans += 1
                i += 1
            else:
                break
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())

ans = 0
if n > 1:
    tmp = sympy.factorint(n)
    for v in tmp.values():
        i = 1
        while v > 0:
            if v - i >= 0:
                v -= i
                ans += 1
                i += 1
            else:
                break
print(ans)
Problem p02767 (python)

Fixed submission:
n = int(input())
x = [int(x) for x in input().split()]

ans = []

for i in range(1, 101):
    tmp = 0
    for j in x:
        tmp += (j - i) ** 2
    ans.append(tmp)

print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(x) for x in input().split()]

ans = []

for i in range(x[0], x[-1] + 1):
    tmp = 0
    for j in x:
        tmp += (j - i) ** 2
    ans.append(tmp)

print(min(ans))
Problem p02928 (python)

Fixed submission:
import sys


def main():
    N, K = map(int, sys.stdin.readline().split())
    A = list(map(int, sys.stdin.readline().split()))

    count1 = 0
    count2 = 0

    for i in range(N - 1):
        for j in range(i + 1, N):
            if A[i] > A[j]:
                count1 = count1 + 1
            if A[i] != A[j]:
                count2 = count2 + 1
    count1 = count1 * K
    count2 = count2 * (K * (K - 1) // 2)

    ans = (count1 + count2) % 1000000007
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys


def main():
    N, K = map(int, sys.stdin.readline().split())
    A = list(map(int, sys.stdin.readline().split())) * K

    count = 0

    for i in range(K * N - 1):
        for j in range(i + 1, N * K):
            if A[i] > A[j]:
                count = count + 1

    ans = count % 1000000007
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys


def main():
    N, K = map(int, sys.stdin.readline().split())
    A = list(map(int, sys.stdin.readline().split())) * K

    tree = [0] * (K * N + 1)
    count = 0

    for i in A:
        tree[i] = tree[i] + 1
        count = count + sum(tree[i + 1 :])

    ans = count % (10 ** 9 + 7)
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys


def main():
    N, K = map(int, sys.stdin.readline().split())
    A = list(map(int, sys.stdin.readline().split())) * K

    count = 0

    for i, n in enumerate(A):
        for j, m in enumerate(A):
            if i <= j:
                break
            elif m > n:
                count = count + 1

    ans = count % (10 ** 9 + 7)
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split())) * K


def main():
    count = 0
    for i in range(0, K * N - 1):
        for j in range(1, K * N):
            if i < j and A[i] > A[j]:
                count = count + 1

    ans = count % (10 ** 9 + 7)
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split())) * K

count = 0

for i in range(0, K * N - 1):
    for j in range(1, K * N):
        if i < j and A[i] > A[j]:
            count = count + 1

ans = count % (10 ** 9 + 7)
print(ans)
Problem p04043 (python)

Fixed submission:
iroha_list = list(map(int, input().split()))
iroha_set = set(iroha_list)

if sum(iroha_list) != 17:
    print("NO")
else:
    if iroha_set == {5, 7}:
        print("YES")
    else:
        print("NO")

Buggy submission (verdict: Runtime Error):
iroha = list(int(input()))

ans = [[5, 5, 7], [5, 7, 5], [7, 5, 5]]

if iroha in ans:
  print("YES")
else:
  print("NO")
Problem p02658 (python)

Fixed submission:
def main():
    N=int(input())
    A=sorted(list(map(int,input().split())))
    ans=1
    if 0 in A:
        print(0)
        return
    for i in range(N):
        ans*=A[i]
        if ans>10**18:
            print(-1)
            return
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
N=int(input())
A=sorted(list(map(int,input().split())))
ans=1
if 0 in A:
    print(0)
    return
for i in range(N):
    ans*=A[i]
    if ans>=10**18:
        print(-1)
        break
else:print(ans)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,input().split())
if c-a-b<0:
    print('No')
else:
    if 4*a*b<(c-b-a)*(c-b-a):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c-a-b<0:
    print('No')
else:
    if 4ab<(c-b-a)*(c-b-a):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c-a-b<0:
    print('No')
else:
    if ab<(c-b-a)*(c-b-a):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c-a-b<0:
    print('No')
else:
    if ab<(c-b-a)*(c-b-a)
        print('Yes')
    else:
        print('No')
Problem p02885 (python)

Fixed submission:
A,B = map(int,input().split())
ans = A - B*2 if A -B*2 >0 else 0
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 1
for i in range(1,N):
  if S[i-1] != S[i]:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 0
for i in range(1,N):
  if S[i-1] != S[i]:
    cnt += 1

print(cnt+1)
Problem p02924 (python)

Fixed submission:
N = int(input())
ans = (N-1)*N//2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = sum(N[:N-1])N = int(input())
ans = round((N-1)*N/2)
print(ans)