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

Fixed submission:
from collections import deque

N,M = map(int,input().split())

List = [ list(map(int,input().split())) for i in range(M)]

dict = { i:[] for i in range(1,N+1)}

for i in range(M):
  a = List[i][0]
  b = List[i][1]
  
  dict[a].append(b)
  dict[b].append(a)


kouho = deque([1])
sumi = [-1 for i in range(N+1)]

while len(kouho) > 0:
  a = kouho.popleft()
  sumi.append(a)

  for t in dict[a]:
    if sumi[t] != -1:
      continue
    else:
      kouho.append(t)
      sumi[t] = a
          
ck = 0

for i in range(2,N+1):
  if sumi[i] == -1:
    ck=1
    
if ck == 1:
  print("No")
else:
  print("Yes")
  
  for i in range(2,N+1):
    print(sumi[i])

Buggy submission (verdict: Runtime Error):
# cook your dish here
def dijkstra_back(s,t,n,w,cost):
    #sからtへの最短経路の経路復元
    prev = [s] * n #最短経路の直前の頂点
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0
    
    while True:
        v = -1
        for i in range(n):
            if (not used[i]) and (v == -1):
               v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
               break
        used[v] = True
        
        for i in range(n):
            if d[i] > d[v] + cost[v][i]: 
                d[i] = d[v] + cost[v][i]
                prev[i] = v
        
    path = [t]
    while prev[t] != s:
        path.append(prev[t])
        prev[t] = prev[prev[t]]
    path.append(s)
    path = path[::-1]
    return path


from scipy.sparse.csgraph import csgraph_from_dense,dijkstra

N,M = map(int,input().split())
edge = [[10**9 for j in range(N+1)] for i in range(N+1)]

for i in range(M):
  a,b = list(map(int,input().split()))
  edge[a][b] = 1
  edge[b][a] = 1

G = csgraph_from_dense(edge, null_value=10**9)
d = dijkstra(G,indices = 1)
ck = 0
for i in range(2,len(d)):
  if d[i] == float('inf'):
    ck = 1
if ck == 1:
  print("No")
else:
  print("Yes")
  for i in range(2,len(d)):
    d = dijkstra_back(1,i,N,M,edge)
    print(d[-2])
Problem p02684 (python)

Fixed submission:
N,K=map(int,input().split())
List=list(map(int,input().split()))

arr = [1]
cnt = 1
b = 10 ** 7
ans = [0 for i in range(N+1)]

for i in range(N):
  if i == 0:
    ans[1] += 1
    s = List[i]
    arr.append(s)    
  else:
    if ans[s] == 1:
      b = arr.index(List[s-1])
      break
    else:
      ans[s] += 1
      s = List[s-1]
      arr.append(s)
            
l = len(arr)
c = int( (K-b) % (l-b) )

if K-b > 0:
  print(arr[b+c])
elif K-b == 0:
  print(arr[b])
else:
  print(arr[K])

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

arr = [1]
cnt = 1

ans = [0 for i in range(N+1)]
ans[0] = 1

for i in range(N):
  if i == 0:
    s = List[i]
    arr.append(s)
    ans[s] += 1
  else:
    if ans[s-1] == 1:
      b = arr.index(List[s-1])
      break
    else:
      s = List[s-1]
      arr.append(s)
      ans[s] += 1
      
l = len(arr)
c = int( (K-b) % (l-b) )

if K-b > 0:
  print(arr[b+c])
else:
  print(arr[K-1])
Problem p02696 (python)

Fixed submission:
A,B,N=map(int,input().split())
import math

if N >= B-1:
  print(math.floor(A*(B-1)/B))
else:
  print(math.floor(A*N/B))

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

print(int(N/abs(A-B)))
Problem p02791 (python)

Fixed submission:
N = int(input())

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

m = 10 ** 10
cnt = 0

for i in range(N):
  a = List[i]
  if a <= m :
    cnt += 1
    m = a
    
print(int(cnt))

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

List = list(map,input().split())

m = 1
cnt = 0

for i in range(N):
  a = List[i]
  if a <= m :
    cnt += 1
    m = a
    
print(int(cnt))
Problem p02802 (python)

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

List = []
ans = [0  for i in range(N+1)]
WA = [0  for i in range(N+1)]

for i in range(M):
  p,S = input().split()
  p = int(p)
  
  if ans[p] == 0:
    if S == "AC":
      ans[p] = 1
    else:
      WA[p] += 1
      
A = sum(ans)

W= 0

for i in range(N+1):
  W += ans[i] * WA[i]

print(A,W)

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

List = []
ans = [0  for i in range(N+1)]
WA = [0  for i in range(N+1)]

for i in range(M):
  p,S = map,input().split()
  
  if ans[p] != 0:
    if S == "AC":
      ans[p] = 1
    else:
      WA[p] += 1
      
A = sum(ans)
W = sum(WA)

print(A,W)
Problem p02855 (python)

Fixed submission:
Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 and Row - i != Row:
    
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr
    
  elif i == 0 and ans[Row-1][0] == -1:
    ans_arr = ans[Row - 2 ]
    ans[Row - 1] = ans_arr
    
for i in range(Row):
  
  arr = ans[i][0]
  if arr == - 1:
    ans_arr = ans[i-1]
    ans[i] = ans_arr
    
for List in ans:
    print(*List)

Buggy submission (verdict: Runtime Error):
Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 and Row - i != Row:
    
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr

if arr[Row-1] == -1:
  ans[Row - 1] = ans[Row - 2]
    
for List in ans:
    print(*List)

Buggy submission (verdict: Runtime Error):
Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 :
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr
  
for List in ans:
    print(*List)

Buggy submission (verdict: Runtime Error):
Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = add + 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 :
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr
  
for List in ans:
    print(*List)
Problem p02963 (python)

Fixed submission:
N = int(input())
a = -(-N//(10**9))
b = a*10**9-N
print(0, 0, 10**9, b, 1, a)

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

if N <= 10**9:
  List = [0,0,0,1,N,0]
else:
  a = -(-S//(10**9))
  b = a*10**9-S
  List = [0,0,10**9,b,a,1]
  
print(*List)
Problem p03043 (python)

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

Buggy submission (verdict: Runtime Error):
def resolve():
    N, K = [int(i) for i in input().split()]
    import math
    ans = 0
    for i in range(1, N + 1):
        if i < K:
            coin = math.ceil(math.log2(K / i))
            ans += (1 / N) * ((1 / 2)**coin)
        else:
            ans += (1 / N)
    print(ans)


resolve()
Problem p03086 (python)

Fixed submission:
S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.append(ans)
    ans = 0
    
arr.append(ans)

print(max(arr))

Buggy submission (verdict: Runtime Error):
S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.append(ans)
    ans = 0
    
print(max(arr))

Buggy submission (verdict: Runtime Error):
S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.appned(ans)
    ans = 0
    
print(max(arr))
Problem p03087 (python)

Fixed submission:
N,Q = map(int,input().split())
S = list(input())

a = [0 for i in range(N)]
b = [0 for i in range(N)]

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    a[i] = 1
    b[i+1] = 1
    
def cumsum(xs):
  result = [xs[0]]
  for x in xs[1:]:
    result.append(result[-1] + x)
  result.append(0)
  result.sort()
  return result

A = cumsum(a)
B = cumsum(b)

for i in range(Q):
  l,r = map(int,input().split())
  print(int(B[r] - A[l-1]))

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

a = [0 for i in range(N)]
b = [0 for i in range(N)]

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    a[i] = 1
    b[i+1] = 1
    
def cumsum(xs):
  result = [xs[0]]
  for x in xs[1:]:
    result.append(result[-1] + x)
  return result

A = cumsum(a)
B = cumsum(b)

for i in range(Q):
  l,r = map(int,input().split())
  print(B[r] - A[l])
Problem p03241 (python)

Fixed submission:
import math
N,M = map(int,input().split())

sq = math.sqrt(M)
sq = math.floor(sq)


ans = 1
for i in range(1,sq+2):
  if M % i == 0:
    if i * N <= M:
      ans = max(i,ans)
    if M / i * N <= M:
      ans = max(M // i,ans)
if N == 1:
  print(int(M))
else:
  print(int(ans))

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

sq = math.sqrt(M)

for i in range(1,sq+1):
  if M % i == 0:
    if i <= math.floor(M/N):
      ans = i
    
print(int(ans))

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

if M % N != 0:
  
  a = int(M % N)
  b = (M - a) / N
  c = math.gcd(a, b)
  print(c)
else:
  print(int(M/N))

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

if M % N != 0:
  
  a = int(M % N)
  b = (M - a) / N
  c = math.gcd(a, b)
  print(c)
else:
  print(int(M/N))
Problem p03281 (python)

Fixed submission:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return len(divisors)
  
ans = 0

for i in range(1,N+1):
  a = make_divisors(i)
  if a ==8 and i%2 == 1 :
    ans += 1
    
print(int(ans))

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
  
print(int(make_divisors(N)))
Problem p03290 (python)

Fixed submission:
d, goal = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for _ in range(d)]

def solve(goal, d):
  if d == 0:
    return 10**9
  n = min(goal//(100*d), pc[d][0])
  t = n * d * 100
  if n == pc[d][0]:
    t += pc[d][1]
  if t < goal:
    n += solve(goal-t, d-1)
  return min(n, solve(goal,d-1))

print(solve(goal,d))

Buggy submission (verdict: Runtime Error):
d, goal = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for _ in range(d)]

def solve(goal, d):
  if d == 0:
    return 10**9
  n = min(goal//(100*d), pc[d][0])
  t = n * d * 100
  if n == pc[d][0]:
    t += pc[d][1]
  if t < goal:
    n += solve(goal-t, d-1)
  return min(n, solve(goal,d-1))

print(solve(g,d))
Problem p03361 (python)

Fixed submission:
H,W = map(int,input().split())
arr = []

for i in range(H):
  S = list(input())
  arr.append(S)
  
ck = 0
for i in range(H):
  for j in range(W):
    if arr[i][j] == "#":
      if i != 0:
        a = arr[i-1][j]
      else:
        a = "."
      if i != H-1:
        b = arr[i+1][j]
      else:
        b = "."
      if j != 0:
        c = arr[i][j-1]
      else:
        c = "."
      if j != W-1:
        d = arr[i][j+1]
      else:
        d = "."

      if a == "." and b == "." and c == "." and d == ".":
        ck = 1
      
if ck == 1:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
arr = []

for i in range(H):
  S = list(input())
  arr.append(S)
  
ck = 0
for i in range(H):
  for j in range(W):
    if arr[i][j] == "#":
      if i != 0:
        a = arr[i-1][j]
      else:
        a = "."
      if i != H-1:
        b = arr[i+1][j]
      else:
        b = "."
      if j != 0:
        c = arr[i][j-1]
      else:
        c = "."
      if j != W-1:
        d = arr[i][j+1]
      else:
        d = "."
    if a == "." and b == "." and c == "." and d == ".":
      ck = 1
      
if ck == 1:
  print("No")
else:
  print("Yes")
Problem p03380 (python)

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

A.sort()

m = A[-1]
M = [abs((m / 2) - a) for a in A[: -1]]
r = A[M.index(min(M))]

print(m, r)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
l = list(map(int,input().split()))

l.sort()

r = bisect.bisect_right(l, l[-1]/2)

a = l[r]
b = l[r+1]

a2 = min(a,l[-1]-a)
b2 = min(b,l[-1]-b)

if a2 >= b2:
  c = a
else:
  c = b

print( int( l[-1] ) ,int(c))

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
l = list(map(int,input().split()))

l.sort()

r = bisect.bisect_right(l, l[-1]/2)

a = l[r]
b = l[r+1]

a = min(a,l[-1]-a)
b = min(b,l[-1]-b)

print( int( l[-1] ) ,max(a,b))
Problem p03549 (python)

Fixed submission:
import math

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(math.round(ans))
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
ans=[]
for i in range(len(s)-len(t)+1):
  start=i
  end=i+len(t)
  ok=True
  for j in range(len(t)):
    if s[start+j]!='?' and s[start+j]!=t[j]:
      ok=False
      break
  if ok:
    a=s[:start]+t+s[end:]
    ans.append(a.replace('?','a'))
if ans:
  ans=sorted(ans)
  print(ans[0])
else:
  print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())

ck = 0
tl = len(T)
arr = []

for i in range(len(S)):
  a = S[i]
  if a == T[ck] or a == "?":
    ck += 1
  else:
    ck = 0
  if tl == ck:
    arr.append(i-tl+1)
  
if len(arr) == 0:
  print("UNRESTORABLE")
else:
  b = arr[-1]
  ans = ""
  for i in range(len(S)):
    if i == b:
      ans += ''.join(T)
    elif i > b and i <= b + tl:
      continue
    else:
      if S[i] == "?":
        ans += "a"
      else:
        ans += S[i]
  print(ans)
Problem p03607 (python)

Fixed submission:
N = int(input())

arr = [ int(input()) for i in range(N)]

arr.sort()
cnt = 0
num = 1

a = arr[0]

for i in range(1,N):
  if arr[i] == a:
    num += 1
  else:
    if num % 2 == 1:
      cnt += 1
    num = 1
    a = arr[i]
if num % 2 == 1:
  cnt += 1

print(int(cnt))

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

arr = [ int(input()) for i in range(N)]

arr.sort()
cnt = 0
num = 1

a = arr[0]

for i in range(1,N):
  if arr[i] == a:
    num += 1
  else:
    num = 1
    if num % 2 == 1:
      cnt += 1
printx(int(cnt))
Problem p03608 (python)

Fixed submission:
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra,floyd_warshall
N,M,R = map(int,input().split())

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

List = [[10**6]*(N) for i in range(N)]
for i in range(M):
  a,b,c = map(int,input().split())
  
  if List[a-1][b-1] > c:
    List[a-1][b-1] = c
    List[b-1][a-1] = c
G = csgraph_from_dense(List, null_value=10**6)
d = floyd_warshall(G)

import itertools
a = list(itertools.permutations(machi))
arr = []
for i in a:
  ans = 0
  for j in range(R):
    if j != R-1 :
      ans += d[i[j]-1][i[j+1]-1]
  arr.append(ans) 
  
print(int(min(arr)))

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra,floyd_warshall
N,M,R = map(int,input().split())

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

List = [[10**6]*(N) for i in range(N)]
for i in range(M):
  a,b,c = map(int,input().split())
  
  if List[a-1][b-1] > c:
    List[a-1][b-1] = c
    List[b-1][a-1] = c
G = csgraph_from_dense(List, null_value=10**6)
d = floyd_warshall(G)

import itertools
a = list(itertools.permutations(machi))
arr = []
for i in a:
  ans = 0
  for j in range(R):
    if j != R-1 :
      ans += d[i[j]-1][i[j+1]-1]
  arr.append(ans) 
  
print(int(min(arr)))
Problem p03633 (python)

Fixed submission:
N = int(input())

arr = [int(input()) for i in range(N) ]

import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)  
  
print(lcm_list(arr))

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

arr = [int(input()) for i in range(N) ]

import math

from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(arr))
Problem p03695 (python)

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

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)

Buggy submission (verdict: Runtime Error):
 int(input())
a = list(map(int, input().split()))
 
c = [0] * 9
 
for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1
 
c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]
 
print(c_min, c_max)
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)

Buggy submission (verdict: Runtime Error):
 int(input())
a = list(map(int, input().split()))
 
c = [0] * 9
 
for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1
 
c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]
 
print(c_min, c_max)
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)
提出情報
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
    a,b,t = map(int,input().split())
    x = t // a
    y = x * b
    print(y)

Buggy submission (verdict: Runtime Error):
a , b , t = map(int(), input().split())
x = 0
y = 0
x = t // a
y = x * b
print(y)

Buggy submission (verdict: Runtime Error):
a,b,t = map(int(),input().split())
x = t // a
y = x * b
print(y)
Problem p02861 (python)

Fixed submission:
import numpy as np
N = int(input())
xy = [list(map(int, input().split(" "))) for i in range(N)]

L = 0
for i in range( N ):
 for j in range( N ):
  a = xy[i][0]-xy[j][0]
  b = xy[i][1]-xy[j][1]
  l = np.sqrt( a**2 +b**2)
  L += l

print(L/N)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
xy = [list(map(int, input().split(" "))) for i in range(N)]

L = 0
for i in range(len(xy)-1):
  a = xy[i][0]-xy[i+1][0]
  b = xy[i][1]-xy[i+1][2]
  l = np.sqrt( a**2 +b**2)
  L += l
print(L)
Problem p02993 (python)

Fixed submission:
S = input()
 
answer = "Good"
prev_s = S[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s
 
print(answer)

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

answer = "Good"
prev_s = s[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s

print(answer)

Buggy submission (verdict: Runtime Error):
import math

A, B, C, D = map(int, input().split())
CD = int(C * D // math.gcd(C, D))

B_in_C = int(B/C)
B_in_D = int(B/D)
B_in_CD = int(B/(CD))
B_con = B - (B_in_C + B_in_D - B_in_CD)

A = A-1 if A > 1 else A
A_in_C = int(A/C)
A_in_D = int(A/D)
A_in_CD = int(A/(CD))
A_con = A - (A_in_C + A_in_D - A_in_CD)

print(B_con - A_con)
Problem p03337 (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())

print(max([A + B, A - B, A * B]))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())

print(max(A + B, A - B, A * B))
Problem p03486 (python)

Fixed submission:
s = input()
t = input()

s = sorted(s)
t = sorted(t)[::-1]

answer = "Yes"
for i in range(len(s)):
  if i == len(t):
    answer = "No"
    break
  s_c = s[i]
  t_c = t[i]
  if s_c < t_c:
    break
  elif s_c == t_c:
    continue
  else:
    answer = "No"
    break

if s == t:
  answer = "No"

print(answer)

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

s = sorted(s)
t = sorted(t)[::-1]

answer = "Yes"
for i in range(len(s)):
  s_c = s[i]
  t_c = t[i]
  if s_c < t_c:
    break
  elif s_c == t_c:
    continue
  else:
    answer = "No"
    break

if s == t:
  answer = "No"

print(answer)

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

s = sorted(s)
t = sorted(t)[::-1]

answer = "Yes"
for i in range(len(s)):
  s_c = s[i]
  t_c = t[i]
  if s_c < t_c:
    break
  elif s_c == t_c:
    continue
  else:
    answer = "No"
    break

if s == t:
  answer = "No"

print(answer)
Problem p02553 (python)

Fixed submission:
nums=list(map(int, input().split()))
ans=[]
for i in range(2):
  ans.append(nums[i]*nums[2])
  ans.append(nums[i]*nums[3])
print (max(ans))

Buggy submission (verdict: Runtime Error):
nums=list(map(int, input().split()))
ans=[]
for i in range(2):
  ans.append(nums[i]*nums[2])
  ans.append(nums[i]*nums[3])
print max(ans)

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

x=a if abs(a)>abs(b) else b
y=c if abs(c)>abs(d) else d

if ( (x>0 and y>0) or (x<0 and y<0) ):
  print (x*y)
else :
  x=a if abs(a)<abs(b) else b
  y=c if abs(c)<abs(d) else d
  print (x*y)
Problem p02657 (python)

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

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

for i in lst:
    mult *= i
    if mult > 10 ** 18:
        print(-1)
        exit()

print(mult)
Problem p02921 (python)

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

print(count)

Buggy submission (verdict: Runtime Error):
s = int(input())
t = int(input())
count = 0
for i in range(len(s)):
    if s[i] == t[i]:
        count += 1
        
print(count)
Problem p03085 (python)

Fixed submission:
s = input()

if s == 'A':
    print('T')
elif s == 'T':
    print('A')
elif s == 'G':
    print('C')
elif s == 'C':
    print('G')

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

if s == 'A':
    print('T')
elif s == 'T':
    print('A')
elif s == 'G':
    print('C')
elif s == 'C':
    print('G')