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

Fixed submission:
n = int(input())
     
f = [int(input().replace(" ", ""), 2) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
     
ans = float('-inf')
     
for i in range(1, 1024):
    price = 0
    for j in range(n):
        price += p[j][bin(i & f[j]).count('1')]
    ans = max(ans, price)
     
print(ans)

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

F = [int(input().replace(" ",""),2) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]


profit = float("-inf")

for i in range(1,1024):
	tmp = 0
	for j in range(N):
		tmp = tmp + (bin(i & F[j]).count('1'))
		tmp2 = P[j][tmp]
	profit = max(profit, tmp2)

print(profit)

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

F = [int(input().replace(" ",""),2) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]


profit = float("-inf")

for i in range(1,1024):
	tmp = 0
	for j in range(N):
		if i & F[j] :
			tmp = tmp + 1
			tmp2 = P[tmp]
	profit = max(profit, tmp2)

print(profit)
Problem p03573 (python)

Fixed submission:
A,B,C=list(input().split())

if A==B:
	print(C)
elif B==C:
	print(A)
else:
	print(B)

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

pair=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
graph=[[0]*N for _ in range(N)] #隣接行列の初期化


for p in pair:
	graph[p[0]][p[1]]= graph[p[1]][p[0]]=1
	
def DFS(v):
	if visited[v]:
		return 
	visited[v]=True
	for j in [j for j,v2 in enumerate(graph[v]) if v2==1]:
		DFS(j)
		
res = 0

for i in range(M):
	visited=[False for _ in range(N)] #訪問済みリストの初期化
	x,y=pair[i]
	graph[x][y]=graph[y][x]=0 #辺を取り除く
	DFS(0 if i>0 else 1)
	
	if not all(visited): #全ての頂点が訪問済みでなかった場合
		res+=1
	
	graph[x][y]=graph[y][x]=1

print(res)

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

pair=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
graph=[[0]*N for _ in range(N)] #隣接行列の初期化


for p in pair:
	graph[p[0]][p[1]]= graph[p[1]][p[0]]=1
	
def DFS(v):
	if visited[v]:
		return 
	visited[v]=True
	for i in [i for i,v2 in enumerate(graph[v]) if v2==1]:
		DFS(i)
		
res = 0

for i in range(M):
	visited=[False for _ in range(N)] #訪問済みリストの初期化
	x,y=pair[i]
	graph[x][y]=graph[y][x]=0 #辺を取り除く
	DFS(0 if i>0 else 1)
	
	if not all(visited): #全ての頂点が訪問済みでなかった場合
		res+=1
	
	graph[x][y]=graph[y][x]=1

print(res)

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

pair=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
graph=[[0]*N for _ in range(N)] #隣接行列の初期化

print(pair)

for p in pair:
	graph[p[0]][p[1]]= graph[p[1]][p[0]]=1
	
def DFS(v):
	if visited[v]:
		return 
	visited[v]=True
	for i in [i for i,v2 in enumerate(graph[v]) if v2==1]:
		DFS(i)
		
res = 0

for i in range(M):
	visited=[False for _ in range(N)] #訪問済みリストの初期化
	x,y=pair[i]
	graph[x][y]=graph[y][x]=0 #辺を取り除く
	DFS(0 if i>0 else 1)
	
	if not all(visited): #全ての頂点が訪問済みでなかった場合
		res+=1
	
	graph[x][y]=graph[y][x]=1

print(res)

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

pair=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
graph=[[0]*N for _ in range(N)] #隣接行列の初期化

print(pair)

for p in pair:
	graph[p[0]][p[1]]= graph[p[1]][p[0]]=1
	
def DFS(v):
	if visited[v]:
		return 
	visited[v]=True
	for i in [i for i,v2 in enumerate(graph[v]) if v2==1]:
		DFS(i)
		
res = 0

for i in range(M):
	visited=[False for _ in range(N)] #訪問済みリストの初期化
	x,y=pair[i]
	graph[x][y]=graph[y][x]=0 #辺を取り除く
	DFS(0)
#	DFS(0 if i>0 else 1)
	
	if not all(visited): #全ての頂点が訪問済みでなかった場合
		res+=1
	
	graph[x][y]=graph[y][x]=1

print(res)
Problem p03695 (python)

Fixed submission:
import math
N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=math.floor(i/400)
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

for i in range(8):
    if Rate[i] > 0:
        a=a+1

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)

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

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

Rate=[]
for i in range(9):
    Rate.append(0)

for i in A:
    index=i/400
    if index>8:
        index=8
    Rate[index]=Rate[index]+1

a=0

for i in range(8):
    if Rate[i]>0:
        a=a+1

Max=a+Rate[8]
Min=min(a,1)

print(Min, Max)
Problem p02705 (python)

Fixed submission:
from math import pi
print(2 * int(input()) * pi)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = list(map(int,input().split()))
if N < sum(A): print(-1)
else: print(N - sum(A))
Problem p02741 (python)

Fixed submission:
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(list[K-1])

Buggy submission (verdict: Runtime Error):
from math import sqrt
a, b, c = map(int,input().split())
if 4*a*b < (c - a - b)**2: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
from math import sqrt
a, b, c = map(int,input().split())
if a + b + 2*sqrt(a*b) < c: print("Yes")
else: print("No")
Problem p02747 (python)

Fixed submission:
S = input()
if S == "hi" or S == "hihi" or S == "hihihi" or S == "hihihihi" or S == "hihihihihi" : print("Yes") 
else: print("No")

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = a[0] + b[0]
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(ans)
Problem p02756 (python)

Fixed submission:
from collections import deque
S = deque(input())
Q = int(input())
rev = 0
for i in range(Q):
  query = input()
  if query == "1": rev = 1 - rev 
  elif int(query[2]) + rev == 2: S.append(query[4])
  else:S.appendleft(query[4])
if rev == 1: S.reverse()  
print("".join(S))

Buggy submission (verdict: Runtime Error):
from collections import deque
S = deque(input())
Q = int(input())
rev = 0
for i in range(Q):
  query = input()
  if query == "1": rev = 1 - rev 
  elif int(query[2]) + rev == 2: S.append(query[4])
  else:S.insert(0,query[4])
if rev == 1: S.reverse()  
print("".join(S))
Problem p02783 (python)

Fixed submission:
from math import ceil
H, A = map(int,input().split())

print(ceil(H/A))

Buggy submission (verdict: Runtime Error):
from math import ceil()
H, A = map(int,input().split())

print(ceil(H/A))
Problem p02784 (python)

Fixed submission:
H, N = map(int,input().split())
A = list(map(int,input().split()))
         
if H <= sum(A): print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int,input().split())
A = list(map(int,input().split())
         
if H <= sum(A): print("Yes")
else: print("No")
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())
print(T + S)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int,input().split())
print(max(0, A - K), max(0,min(B, A + B - K)))
Problem p03196 (python)

Fixed submission:
from math import ceil
N, P = map(int,input().split())
if N >= 40: print(1)
elif N == 1: print(P)  
else:
  ans = 1
  for i in range(1,ceil(P ** (1 / N))):
    if P % ((i + 1) ** N) == 0:
      ans = i + 1
  print(ans)

Buggy submission (verdict: Runtime Error):
from math import ceil
N, P = map(int,input().split())
if N >= 40: print(1)
else:
  ans = 1
  for i in range(1,ceil(P ** (1 / N))):
    if P % ((i + 1) ** N) == 0:
      ans = i + 1
print(ans)
Problem p03992 (python)

Fixed submission:
s = input()
print(s[:4] + " " + s[4:])

Buggy submission (verdict: Runtime Error):
`r`````````````````. ````````@|@|@|@|@|@|@|@|@|@|@|@|i
Problem p02553 (python)

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

Buggy submission (verdict: Runtime Error):
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

const int MOD = 1000000007;

// vector<vector<int>> data(3, vector<int>(4));

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  ll ans = a * c;
  ans = max(ans, a * d);
  ans = max(ans, b * c);
  ans = max(ans, b * d);

  printf("%lld", ans);
}
Problem p02917 (python)

Fixed submission:
n=int(input())
b=list(map(int,input().split()))
ans=0
if n==2:
  print(2*b[0])
else:
  for i in range(n-2):
    ans+=min(b[i],b[i+1])
  print(ans+b[-1]+b[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
b=list(map(int,input().split()))
ans=0
if n==2:
  print(2*b[0])
else:
  for i in range(n-2):
    ans+=min(b[i],b[i+1])
  print(ans+b[n]+b[0])
Problem p02934 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
bunshi=1
for i in range(n):
  bunshi*=a[i]
bunbo=0
for i in range(n):
  bunbo+=bunshi//a[i]
print(float(bunshi)/float(bunbo))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=	1/float(a[n])
print(1/float(ans))
Problem p02973 (python)

Fixed submission:
import bisect
n=int(input())
h=[]
for i in range(n):
  a=int(input())
  if len(h)==0:
    h.append(-1*a)
  elif (-1)*a>=h[-1]:
    h.append(-1*a)
  else:
    index=bisect.bisect_right(h,-1*a)
    h[index]=-1*a
print(len(h))

Buggy submission (verdict: Runtime Error):
import bisect
n=int(input())
h=[]
for i in range(n):
  a=int(input())
  if len(h)==0:
    h.append(-1*a)
  elif (-1)*a>=h[-1]:
    h.append(-1*a)
  else:
    index=bisect.bisect_right(h,-1*a)
    h[index]=-1*a
  print(h)
print(len(h))
Problem p03006 (python)

Fixed submission:
from collections import Counter
n=int(input())
x=[]
y=[]
for i in range(n):
  a,b=map(int,input().split())
  x.append(a)
  y.append(b)
cost=n
list=[]
for i in range(n):
  for j in range(n):
    if i != j:
      list.append([x[i]-x[j],y[i]-y[j]])

if n ==1:
  print(cost)
else:
  c=Counter(map(tuple, list))
  mode=c.most_common(1)
  print(cost-mode[0][1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
x=[]
y=[]
for i in range(n):
  a,b=map(int,input().split())
  x.append(a)
  y.append(b)
cost=n
list=[]
for i in range(n):
  for j in range(n):
    if i != j:
      list.append([x[i]-x[j],y[i]-y[j]])
c=Counter(map(tuple, list))
mode=c.most_common(1)
print(cost-mode[0][1])
Problem p03037 (python)

Fixed submission:
n,m=map(int,input().split())
listl=[]
listr=[]
for i in range(m):
  l,r=map(int,input().split())
  listl.append(l)
  listr.append(r)
maxl=max(listl)
minr=min(listr)
if minr-maxl+1>=1:
  print(minr-maxl+1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
count=0
x=[]
for i in range(m):
  l,r=map(int,input().split())
  x.append([l,r])
  
for j in range(1,n+1):
  for k in range(m):
    if x[k,0]<=j:
      if x[k,1]>=j:
        count+=1
        
print(count)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
count=0
for j in range(1,n+1):
  for i in range(m):
    l,r=map(int,input().split())
    if l<=j:
      if j<=r:
        count+=1
print(count)
Problem p03043 (python)

Fixed submission:
n,k=map(int,input().split())
p=float(0.0)
for i in range(1,n+1):
  howmany=0
  while i<k:
    i*=2
    howmany+=1
  p+=1/(n*(2**howmany))
print(p)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=float(0.0)
for i in range(1,n+1):
  divide=float(k/i)
  howmany=max(math.ceil(math.log(divide,2)),0)
  p+=1/(n*(2**howmany))
print(p)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=float(0)
for i in range(1,n+1):
  divide=float(k/i)
  howmany=math.ceil(math.log(divide,2))
  p+=1/(n*(2**howmany))
print(p)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=float(0)
for i in range(1,n+1):
  divide=float(k//i)
  howmany=math.ceil(math.log(divide,2))
  p+=(1//n)*(0.5**howmany)
print(p)
Problem p03061 (python)

Fixed submission:
import fractions
n=int(input())
a=list(map(int,input().split()))
l=[a[0]]
r=[a[-1]]
for i in range(n-1):
  l.append(fractions.gcd(l[i],a[i+1])) #l[i] は最初i個
for i in range(n-1):
  r.append(fractions.gcd(r[i],a[-2-i])) #r[i]は右i r[n-1]=全部 l[0]and r[n-3]
m=[l[n-2],r[n-2]]
for i in range(n-2):
  m.append(fractions.gcd(l[i],r[n-i-3]))
print(max(m))

Buggy submission (verdict: Runtime Error):
import copy
import math

n=int(input())
a=list(map(int,input().split()))
ans=0
r=[]
if n==2:
    print(max(a[0],a[1]))
else:
    for i in range(n):
      l=a.copy()
      del l[i]
      r.clear()
      for j in range(n-2):
        r.append(math.gcd(l[j],l[j+1]))
      g=r[-1]
      if ans<g:
        ans=g
    print(ans)

Buggy submission (verdict: Runtime Error):
import copy
import math

n=int(input())
a=list(map(int,input().split()))
ans=0
r=[]
if n==2:
    print(max(a[0],a[1]))
else:
    
    for i in range(n):
      l=copy.copy(a)
      del l[i]
      r.clear()
      for j in range(n-2):
        r.append(math.gcd(l[j],l[j+1]))
      g=r[-1]
      if ans<g:
        ans=g
    print(ans)

Buggy submission (verdict: Runtime Error):
import copy

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  l=copy.copy(a)
  del l[i]
  r=[]
  for j in range(n-2):
    r.append(gcd(l[j],l[j+1]))
  g=max(r)
  if ans<g:
    ans=g
print(ans)

Buggy submission (verdict: Runtime Error):
import functools
import math
import copy

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  l=copy.copy(a)
  del l[i]
  g=functools.reduce(math.gcd, l)
  if ans<g:
    ans=g
print(ans)

Buggy submission (verdict: Runtime Error):
import functools
import math
import copy

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    l=copy.copy(a)
    del l[i]
    gcd=functools.reduce(math.gcd, l)
    if ans<gcd:
        ans=gcd
print(ans)

Buggy submission (verdict: Runtime Error):
import functools
import math
import copy

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    l=copy.copy(a)
    del l[i]
    gcd=functools.reduce(math.gcd, l)
    if ans<gcd:
        ans=gcd
print(ans)

Buggy submission (verdict: Runtime Error):
import functools
import math

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  l=a
  del l[i]
  ans=max(ans,functools.reduce(math.gcd, l))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  l=a
  del l[i]
  ans=max(ans,gcd(l))
print(ans)
Problem p03102 (python)

Fixed submission:
n,m,c=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n+1)]
count=0
for i in range(n):
  sum=c
  for j in range(m):
    sum+=a[i+1][j]*a[0][j]
  if sum>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(int,input())
a=[list(map(int,input().split())) for i in range(n)]
count=0
for i in range(n):
  sum=c
  for j in range(m):
    sum+=a[i,j]*b[j]
  if sum>0:
    sum+=1
print(sum)
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
count=0
for i in range(105):
  j=101-i
  if a%j==0 and b%j==0:
    count+=1
    if count==k:
      print(j)
      exit()

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
count=0
for i in range(1,ab):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(i)
      exit()

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
count=0
for i in range(ab):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(i)
      exit()

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
count=0
for i in range(ab):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(k)
      exit()
Problem p03111 (python)

Fixed submission:
n,a,b,c=map(int,input().split())
l=[]
for _ in range(n):
  d=int(input())
  l.append(d)

def dfs(cur,x,y,z):
  if cur==n and min(x,y,z)>0:
    return abs(a-x)+abs(b-y)+abs(c-z)-30
  elif cur==n:
    return 100000000000000000000
  ret0=dfs(cur+1,x,y,z)
  ret1=dfs(cur+1,x+l[cur],y,z)+10
  ret2=dfs(cur+1,x,y+l[cur],z)+10
  ret3=dfs(cur+1,x,y,z+l[cur])+10
  return min(ret0,ret1,ret2,ret3)

print(dfs(0,0,0,0))

Buggy submission (verdict: Runtime Error):
n,a,b,c=map(int,input().split())
l=[]
for _ in range(n):
  x=int(input())
  l.append(x)

def dfs(cur,x,y,z):
  if cur==n and min(x,y,z)>0:
    return abs(a-x)+abs(b-y)+abs(c-z)-30
  elif cur==n:
    return inf
  ret0=dfs(cur+1,x,y,z)
  ret1=dfs(cur+1,x+l[cur],y,z)+10
  ret2=dfs(cur+1,x,y+l[cur],z)+10
  ret3=dfs(cur+1,x,y,z+l[cur])+10
  return min(ret0,ret1,ret2,ret3)

print(dfs(0,0,0,0))
Problem p02621 (python)

Fixed submission:
a = int(input())
sum_a = a + a ** 2 + a ** 3
print(sum_a)

Buggy submission (verdict: Runtime Error):
a = int(input())
print(a + a**2 + a**3
Problem p02717 (python)

Fixed submission:
x, y, z = map(int, input().split())
print("{} {} {}".format(z, x, y))

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
print(f"{z} {x} {y}")

Buggy submission (verdict: Runtime Error):
a = int(input("Enter a number for X: "))
b = int(input("Enter a number for Y: "))
c = int(input("Enter a number for Z: "))

print(f"{c} {a} {b}")

Buggy submission (verdict: Runtime Error):
def generator(A, B, C):
    return f"{C} {A} {B}"
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')N, M = map(int, input().split())
A = list(map(int, input().split()))
check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1
ans = N - x
if ans >= M :
    print('Yes')
else:
    print('No')
Problem p02765 (python)

Fixed submission:
n,r =map(int,input().split())
if n < 10 :
  print(100 * (10 - n) + r)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
n,r =int(input().split())
if n < 10 :
  print(100 * (10 - n) + r)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
n,r = map(int(input(),split()))
if n < 10 :
  print(100 * (10 - n) + r)
else:
  print(r)
Problem p02553 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
ac = a * c
ad = a * d
bc = b * c
bd = b * d
ans_1 = max(ac,ad)
ans_2 = max(bc, bd)
ans = max(ans_1, ans_2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
ac = a * c
ad = a * d
bc = b * c
bd = b * d
ans_1 = math.max(ac,ad)
ans_2 = math.max(bc, bd)
ans = math.max(ans1_, ans2)
print(ans)
Problem p02553 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print (max(a*c,a*d,b*c,b*d)
Problem p02678 (python)

Fixed submission:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()

rt = [[] for i in range(n)]
srb = [None] * n
dk = [10**10]*n


for i in range(m):
    a,b = mi()
    rt[a-1].append(b-1)
    rt[b-1].append(a-1)

from collections import deque
l = deque()

srb[0] = 0
for i in rt[0]:
    l.append(i)
    srb[i] = 1

while len(l) != 0:
    c = l.popleft()
    for i in rt[c]:
        if srb[i] == None:
            l.append(i)
            srb[i] = c+1

print('Yes')
for i in range(1,n):
    print(srb[i])

Buggy submission (verdict: Runtime Error):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()

rt = [[] for i in range(n)]
srb = [None] * n
dk = [10**10]*n


for i in range(m):
    a,b = mi()
    rt[a-1].append(b-1)
    rt[b-1].append(a-1)

from collections import deque
l = deque()

srb[0] = 0
for i in rt[0]:
    l.append(i)
    srb[i] = 1

while len(l) != 0:
    print(l)
    c = l.popleft()
    for i in rt[c]:
        if srb[i] == None:
            l.append(i)
            srb[i] = c+1

print('Yes')
for i in range(1,n):
    print(srb[i])
Problem p02705 (python)

Fixed submission:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

import numpy as np

n = ii()
print(n*2*np.pi)

Buggy submission (verdict: Runtime Error):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

import numpy as np

n = ii()
print(n*2*np.pi)
Problem p02743 (python)

Fixed submission:
mi = lambda : map(int,input().split())

a,b,c = mi()

x = c-a-b
if x < 0:
    print('No')
elif 4* a*b < (c-a-b)**2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
mi = lambda : map(int,input().split())

import math

a,b,c = mi()

# if a+b-c/2 >= math.sqrt(a*b):
if math.sqrt(a) + math.sqrt(b) < math.sqrt(c)
    print('Yes')
else:
    print('No')
Problem p02934 (python)

Fixed submission:
n = int(input())
a = [1/int(e) for e in input().split()]

print(1/sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(1/e) for e in input().split()]

print(1/sum(a))

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

print(1/sum(a))

Buggy submission (verdict: Runtime Error):
def main():
    
    n = int(input())
    a = []
    for i in range(n): 
        a.append( 1/int(input()))

    print(1/sum(a))
    

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    
    n = int(input())
    a = []
    for i in range(n): 
        a.append( 1/int(input()))

    print(sum(a))
    

if __name__ == "__main__":
    main()