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

Fixed submission:
N, K = map(int, input().split(' '))
count = (N - 1) * (N - 2) // 2
is_connect = [[False for _ in range(N)] for _ in range(N)]
if K > count:
  print(-1)
else:
  for i in range(1, N):
    is_connect[0][i] = True
  i = 2
  j = 1
  for _ in range(count - K):
    is_connect[j][i] = True
    if i == N - 1:
      j += 1
      i = j + 1
    else:
      i += 1
  print(N - 1 + count - K)
  for i in range(N):
    for j in range(N):
      if i != j and is_connect[i][j]:
        print('{0} {1}'.format(i + 1, j + 1))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
count = (N - 1) * (N - 2) // 2
is_connect = [[False for _ in range(N)] for _ in range(N)]
if K > count:
  print(-1)
else:
  for i in range(1, N):
    is_connect[0][i] = True
  i = 2
  j = 1
  for _ in range(count - K):
    is_connect[j][i] = True
    i += 1
    if i == N - 1:
      j += 1
      i = j + 1
  for i in range(N):
    for j in range(N):
      if i != j and is_connect[i][j]:
        print('{0} {1}'.format(i + 1, j + 1))
Problem p03160 (python)

Fixed submission:
f_inf = float('inf')
N = int(input())
h = list(map(int, input().split(' ')))
h.append(f_inf)
h.append(f_inf)
dp = [f_inf for _ in range(N + 100)]
dp[0] = 0
for i in range(N-1):
  dp[i+1] = min(dp[i] + abs(h[i+1] - h[i]), dp[i+1])
  dp[i+2] = min(dp[i] + abs(h[i+2] - h[i]), dp[i+2])
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
h = list(map(int, input().split(' ')))
h.append(math.inf)
h.append(math.inf)
dp = [math.inf for _ in range(N + 100)]
dp[0] = 0
for i in range(N-1):
  dp[i+1] = min(dp[i] + abs(h[i+1] - h[i]), dp[i+1])
  dp[i+2] = min(dp[i] + abs(h[i+2] - h[i]), dp[i+2])
print(dp[N-1])
Problem p02756 (python)

Fixed submission:
S=input()
q=int(input())
RV=0
A="A"
for i in range(q):
    IN=input()
    if IN=="1":
        RV+=1
    else:
        t,f,c=IN.split()
        if RV%2==0:
            if f=="1":
                A=c+A               
            else:
                A=A+c
        else:
            if f=="1":
                A=A+c
            else:
                A=c+A
if RV%2==0:
    for i in range(len(A)):
        if A[i]=="A":
            print(A[:i]+S+A[i+1:])
else:
    A=A[::-1]
    for i in range(len(A)):
        if A[i]=="A":
            print(A[:i]+S[::-1]+A[i+1:])

Buggy submission (verdict: Runtime Error):
from collections import deque
S=input()
q=int(input())
que=deque(S)
rev=False
for i in range(q):
      s=input()
      if s=='1':
            rev=not rev
      else:
            t,f,c=s.split()
            if (f=='1' and rev==False) or (f=='2' and rev==True):
                  que.appendleft(c)
            else:
                  que.append(c)
if rev:
      que=que[::-1]
print(''.join(que))

Buggy submission (verdict: Runtime Error):
from collections import deque
S=deque([input()])
q=int(input())
rev=False
for i in range(q):
   s=input()
   if s=="1":
      rev= not rev
   else:
      t,f,c=s.split()
      if (rev==False and f=="1") or (rev==True and f=="2"):
         S.appendleft(c)
      else:
         S.append(c)
if rev==False:
   print("".join(S))
else:
   print("".join(S[::-1]))
Problem p02780 (python)

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

S=[0]*(n+1)
S[1]=P[0]
for i in range(2,n+1):
        S[i]=S[i-1]+P[i-1]
ma=0
for i in range(k,n+1):
       s=S[i]-S[i-k]
       if ma<s:
              ma=s
print((ma+k)/2)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
P=list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n+1):
    dp[i+1]+=dp[i]+P[i]
ans=0
for i in range(n-k+1):
    ans=max(ans,dp[i+k]-dp[i])
print((ans+k)/2)
Problem p02783 (python)

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

if h%a:
       print(h//a+1)
else:
       print(h//a)

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = []
b = []
for _ in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
 
dp = [float("inf")] * (2 * 10000 + 1)
dp[0] = 0
for i in range(h):
    for j in range(n):
        if (i + a[j]) > 2 * 10000:
            dp[2 * 10000] = min(dp[2 * 10000], dp[i] + b[j])
            continue
        dp[i + a[j]] = min(dp[i + a[j]], dp[i] + b[j])
 
ans = float('inf')
for j in range(h, 2 * 10000 + 1):
    ans = min(ans, dp[j])
print(ans)
Problem p02786 (python)

Fixed submission:
h=int(input())

a=1
b=0
ans=0
for i in range(1,41):
       if h<a:
              break
       ans+=a
       a=a*2
       b+=1
print(ans)

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

a=1
b=1
ans=0s
for i in range(1,h+1):
       if i==b:
              ans+=b
              b=b*2
              
print(ans)
Problem p02787 (python)

Fixed submission:
h, n = map(int, input().split())
a = []
b = []
for _ in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
 
dp = [float("inf")] * (2 * 10000 + 1)
dp[0] = 0
for i in range(h):
    for j in range(n):
        if (i + a[j]) > 2 * 10000:
            dp[2 * 10000] = min(dp[2 * 10000], dp[i] + b[j])
            continue
        dp[i + a[j]] = min(dp[i + a[j]], dp[i] + b[j])
 
ans = float('inf')
for j in range(h, 2 * 10000 + 1):
    ans = min(ans, dp[j])
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline
 
h,n = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(n)]

inf=float("inf")
dp=[inf]*(h+1)
 
dp[0]=0

for a,b in AB:
    for i in range(h):
        if dp[i]!=float("inf"):
            dp[min(i+a,h)]=min(dp[min(i+a,h),dp[i]+b])
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
h, n = map(int, input().split())
A = []
B = []
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
  
dp=[float("inf")]*h
dp[0]=0
answer = float("inf")

for i in range(h+1):
    for j in range(n):
      if i + A[j] < h:
        dp[i+A[j]]=min(dp[i+A[j]],dp[i]+B[j])
      else:
        answer = min(answer, dp[i]+B[j])
print(answer)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

h, n = map(int, input().split())
A = []
B = []
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

Ama = max(A)

dp=[float("inf")]*(h+Ama)
dp[0]=0

for i in range(n):
    for j in range(A[i],h+Ama+1):
        dp[j]=min(dp[j],dp[j-A[i]+B[i]])
print(min(dp[h:]))
Problem p02801 (python)

Fixed submission:
c=input()
L=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

for i in range(len(L)):
    if c==L[i]:
        print(L[i+1])

Buggy submission (verdict: Runtime Error):
c=input()
S='abcdefghijklmnopqrstuvwxyz"
for i in range(26):
  if c==S[i]:
    print(S[i+1])
Problem p02804 (python)

Fixed submission:
M,K = map(int,input().split())
L = list(map(int,input().split()))
L.sort()
ANS = 0
 
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
 
mod = 10**9+7 #出力の制限
N = 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
 
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
 
for j in range(M-K+1):
    ANS += (L[K-1+j] - L[M-K-j])*cmb(K-1+j,K-1,mod)
 
print(ANS % mod)

Buggy submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


nn,k=map(int,input().split())
*A,=sorted(map(int,input().split()))
B=sorted(A,reverse=True)
mod=10**9+7

mi,ma=0,0
for i in range(k-1,nn):
    L=cmb(i,k-1,mod)    
    ma+=L*A[i]
    mi+=L*B[i]
    
print((ma-mi)%mod)
Problem p02837 (python)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    a = int(input())
    l.append([tuple(map(int, input().split())) for _ in range(a)])
 
cnt = 0
for i in range(1 << n):
    Flag = True
    for j in range(n):
        if (i >> j) & 1:
            for x, y in l[j]:
                if i >> (x-1) & 1 != y:
                    Flag = False
                    break
    if Flag:
        cnt = max(cnt, sum(map(int, bin(i)[2:])))
 
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=[]
B=[]
for i in range(n):
   a=int(input())
   A.append(a)
   d=[]
   for j in range(a):
      x,y=map(int,input().split())
      d.append((x,y))
   B.append(d)
c=0
for i in range(2**n):
   L=[0]*n
   for j in range(n):
      if i>>j&1
         L[j]=1
   if 1 in L:
      flag=True
      for k in range(n):
         if L[k]==1:
            for m in range(A[k]):
               if L[B[k][m][0]-1]!=B[k][m][1]:
                  flag=False
                  break
      if flag:
         c=max(sum(L),c)
print(c)
Problem p02850 (python)

Fixed submission:
from collections import deque
 
N = int(input())
edges = [[] for _ in range(N + 1)]
ends = []
 
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a].append(b)
    ends.append(b)
 
nodes = deque([1])
count = [0] * (N + 1)
 
while nodes:
    node = nodes.popleft()
    nodes.extend(edges[node])
 
    c = 0
    for n in edges[node]:
        c += 1 + (c + 1 == count[node])
        count[n] = c
 
print(max(count))
for i in ends:
    print(count[i])

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

n=int(input())
E=[[]for _ in range(n)]
for i in range(n-1):
   a,b=map(int,input().split())
   E[a-1].append(b-1)

que=deque([0])
ans=[0]*n
while que:
   s=que.pop()
   color=1
   for ni in E[s]:
      if color==ans[s]:
         color+=1
      ans[ni]=color
      color+=1
      que.append(ni)
print(max(ans))
for i in L:
   print(ans[i])

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

n=int(input())
E=[[]for _ in range(n)]
L=[]
for i in range(n-1):
   a,b=map(int,input().split())
   E[a-1].append(b-1)
   L.append(b-1)

que=deque([0])
ans=[0]*n
while que:
   s=que.pop()
   color=1
   for ni in E[s]:
      if color==ans[s]:
         color+=1
      else:
         ans[ni]=color
         color+=1
         que.append(ni)
print(max(ans))
for i in L:
   print(ans(i))
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
cap=a**2*b
y=((cap-x)*2)/a**2

if y<=b:
      y=((cap-x)*2)/a**2
      theta=math.degrees(math.atan(y/a))
      print(theta)
else:
      y=(2*x)/(a*b)
      theta=math.degrees(math.atan(y/b))
      print(90-theta)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
cap=a**2*b
y=((cap-x)*2)/a**2

if y<=b:
      y=((cap-x)*2)/a**2
      theta=math.degrees(math.atan(y/a))
      print(ans)
else:
      y=(2*x)/(a*b)
      theta=math.degrees(math.atan(y/b))
      print(90-theta)
Problem p02888 (python)

Fixed submission:
import bisect

n=int(input())
L=[int(i) for i in input().split()]

L.sort()

s=0
for i in range(n-1):
      for j in range(i+1,n):
            index=bisect.bisect_left(L,L[i]+L[j])
            s+=index-(j+1)
print(s)

Buggy submission (verdict: Runtime Error):
import bisect

n=int(input())
*L,=map(int,input().split())

L.sort()

ans=0
for i in range(n-1):
      for j in range(i+1,n):
            index=bisect.bisect_left(L,L[i]+L[j])
            ans+=index-L[j+1]
print(ans)
Problem p02911 (python)

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

lis_A = []
lis_K = [lis_NKQ[1] for i in range(lis_NKQ[0])]
lis_K = list(map(lambda x: x - lis_NKQ[2],lis_K))

for i in range(lis_NKQ[2]):
    inp = int(input())
    lis_A.append(inp)
    lis_K[inp - 1] += 1  

for i in lis_K:
    if i > 0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
A=[int(input()) for i in range(q)]
P=[k-q for i in rage(n)]

for i in range(q):
      P[A[i]-1] +=1

for i in range(n):
      if P[i]>0:
            print("Yes")
      else:
            print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
A=[int(input()) for i in range(n)]

P=[k-q for i in rage(n)]

for i in range(q):
      P[A[i]-1] +=1

for i in range(n):
      if P[i]>0:
            print("Yes")
      else:
            print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
L = [int(input()) for i in range(q)]
P = [k - q for i in range(n)]
          
for i in range(q):
      P[L[i]] += 1

for i in range(n):      
      if P[i] > 0:
            print("Yes")
      else:
            print("No")
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
c=0
for i in range(3):
  if s[i]==t[i]:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
s,t=inut(),input()
print(len([1 for i in range(3) if s[i]==t[i]]))
Problem p02936 (python)

Fixed submission:
N, Q = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
PX = [list(map(int, input().split())) for _ in range(Q)]
 
graph = [[] for _ in range(N + 1)]
for a, b in AB:
  graph[a].append(b)
  graph[b].append(a)
  
cost = [0] * (N + 1)
for p, x in PX:
  cost[p] += x
  
check = [0] * (N + 1)
stack = [1]
check[1] = 1
 
while stack:
  s = stack.pop()
  for g in graph[s]:
    if check[g] == 0:
      check[g] = 1
      cost[g] += cost[s]
      stack.append(g)
      
print(*cost[1:])

Buggy submission (verdict: Runtime Error):
from collections import deque
n,q=map(int,input().split())
L=[[]for _ in range(n)]
V=[False]*n
P=[0]*n
for i in range(n-1):
   a,b=map(int,input().split())
   L[a-1].append(b-1)
   L[b-1].append(a-1)
for i in range(q):
   p,x=map(int,input().split())
   P[p-1]+=x
que=deque([0])
while que:
   s=que.popleft()
   V[s]=True
      for ni in L[s]:
         if V[ni]==False:
            P[ni]+=P[s]
            que.append(ni)
print(*P)
Problem p02946 (python)

Fixed submission:
K,X = map(int, input().split())

lis = [i for i in range(X-K+1,X+K)]
print(' '.join(map(str,lis)))

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

lis = [i for i in range(X-K+1,X+K)]
print(' '.join(map(str,r)))
Problem p02983 (python)

Fixed submission:
from itertools import combinations

l,r = map(int,input().split())

if r - l >= 2019:
    print(0)
else:
    m = 2019
    for i, j in combinations(range(l, r+1),2):
        tmp = i*j % 2019
        if m > tmp:
            m = tmp
    print(m)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())

if r-l>=2019:
    print(0)
else:
    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())

if r-l >= 2019:
      print(0)
else:
      m = 2019
      for i in range(l,r):
            for j in range(i+1,r+1):
                  m = min(m,(i*j)%2019)
print(m)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())

if r-l >= 2019:
      print(0)
else:
      m = 2019
      for i in range(l,r+1):
            for j in range(i+1,r+1):
                  m = min(m,(i*j)%2019)
print(m)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())

if (r-l) >= 2019:
      print(0)
else:
      m = float('inf')
      for i in range(l,r+1):
            for j in range(i+1,r+1):
                  m = min(m,(i*j)%2019,)
print(m)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
l,r = map(int,input().split())

m = 2019
for i, j in combinations(range(l, r+1),2):
      tmp = i*j % 2019
      if m > tmp:
            m = tmp
print(m)
Problem p03031 (python)

Fixed submission:
n, m = map(int, input().split())
k = [[int(i) for i in input().split(" ")] for i in range(m)]
p = [int(i) for i in input().split(" ")]
c = 0
for i in range(2**n):
    t = bin(i+2**n)[2:]
    a = sum([0 if sum([1 if t[l]=="1" else 0 for l in k[j][1:]])%2 == p[j] else 1 for j in range(len(k))])
    if a == 0:
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
k=[]
ans=0
for i in range(m):
      a=list(map(int,input().split()))
      k.append(a)
p=list(map(int,input().split()))
for i in range(2**n):
      L=[0]*n
      for j in range(n):
            if ((i>>j)&1):
                  L[j]=1
      flag=True
      for j in range(n):
            s=0
            for e in range(k[j][0]):
                  s+=L[k[j][e+1]-1]
            if s%2!=p[j]:
                  flag=False
      if flag:
            ans+=1
print(ans)
Problem p03037 (python)

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

a=0
b= float('inf')
for i in range(m):
      c,d=map(int,input().split())
      a=max(a,c)
      b=min(b,d)

print(max(0,b-a+1))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=0
b=float('inf')
for i in range(m):
      c,d=map(int,input().spilt())
      a=max(a,c)
      b=min(b,d)
print(max(0,b-a+1))
Problem p03076 (python)

Fixed submission:
import math
ans = 0
min_mod = 10
for i in range(5):
      a = int(input())
      ans += math.ceil(a/10)*10
      if a % 10 != 0:
            min_mod = min(min_mod,a%10)
print(ans + min_mod - 10)

Buggy submission (verdict: Runtime Error):
lis = [str(input()) for i in range(5)]

m = 10
ss = 0
for i in range(5):
      if 0 != int(lis[i][-1]) < m:
            idx = i
            m =  int(lis[i][-1])
            ss = lis[i]

for i in range(5):
      if int(lis[i][-1]) != 0:
            lis[i] = (int(lis[i])//10)*10 + 10
      else:
            lis[i] = int(lis[i])

lis[idx] = int(ss)

print(sum(lis))
Problem p03161 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * n
a[0] = 0
for i in range(1, n):
      hi = h[i]
      a[i] = min(a[j] + abs(hi - h[j]) for j in range(max(0, i - k), i))
print(a[-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
a = [0]*n
for i in range(1, n):
      hi = h[i]
      for j in range(max(0,i-k)i):
            a[i] = min(a[j] + abs(hi - h[j])
print(a[-1])

Buggy submission (verdict: Runtime Error):
 n, k = map(int, input().split())
    h = list(map(int, input().split()))
    a = [0] * n
    a[0] = 0
    for i in range(1, n):
        hi = h[i]
        a[i] = min(a[j] + abs(hi - h[j]) for j in range(max(0, i - k), i))
    print(a[-1])

Buggy submission (verdict: Runtime Error):
in, k = map(int, input().split())
h = [int(i) for i in input().split()]
# dpの最小値を変更する関数
def chmin(a, b):
    if a > b:
        return b
    else:
        return a
# 無限大の値
f_inf = float('inf')
# DP テーブルを初期化　(最小化問題なので INF に初期化)
dp = [f_inf] * (10**5+10)
# 初期条件
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
print(dp[n-1])
Problem p03264 (python)

Fixed submission:
n=int(input())
print((n//2)**2 if n%2==0 else (n//2)*(n//2+1))

Buggy submission (verdict: Runtime Error):
k=int(input)
print((k//2)**2 if k%2==0 else ((k+1)//2**2)-k)

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print((n//2)**2)
else:
  print((n//2)*((n//)2+1))

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print((n//2)**2)
else:
  print(n//2*(n//2+1))
Problem p03289 (python)

Fixed submission:
s=input()
if s[0]!="A":
      print("WA")
      exit()
if s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]!="A" and s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")

Buggy submission (verdict: Runtime Error):
s=input()
ss=s[1:-1]

if s[0]=="A" and  ss.count("C")==1:
      s[0]="a"
      s=list(s)
      s.remove("C")
      if ''.join(s).islower():
            print("AC")
else:
      print("WA")
Problem p03292 (python)

Fixed submission:
a,b,c=map(int,input().split())
d,e,f=abs(a-b),abs(a-c),abs(b-c)
print(d+e+f-max(d,e,f))

Buggy submission (verdict: Runtime Error):
L=map(int,input().split())
L.sort()
s=0
for i in range(1,3):
  s+=L[i]-L[i-1]
print(s)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d,e,f=map(abs,a-b,a-c,b-c)
print(d+e+f-min(d,e,f))
Problem p03415 (python)

Fixed submission:
a=input()[0]
b=input()[1]
c=input()[2]
print(a+b+c)

Buggy submission (verdict: Runtime Error):
a,x,x=input().split()
x,b,x=input().split()
x,x,c=input().split()
print(a+b+c)
Problem p03547 (python)

Fixed submission:
a,b=input().split()
print("=" if a==b else "<" if a<b else ">")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print("=" if a==b elif a>b ">" else "<")
Problem p03729 (python)

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

if a[-1]==b[0] and b[-1]==c[0]:
    print('YES')
else:
    print('NO')

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

if a[-1]==b[0] and b[-1]==c[0]:
    print('YES')
else:
    print('NO')
Problem p03760 (python)

Fixed submission:
a=list(input())
b=list(input())

L=[0]*(len(a)*2)

if len(a)==len(b):
    for i in range(len(a)):
        L[i*2]=a[i]
        L[i*2+1]=b[i]
else:
  for i in range(len(a)-1):
    L[i*2]=a[i]
    L[i*2+1]=b[i]
  L[-2]=a[-1]
  del L[-1]
 
print("".join(L))

Buggy submission (verdict: Runtime Error):
a=list(input())
b=list(input())

L=[0]*(len(a)*2)
for i in range(len(a)-1):
  L[i*2]=a[i]
  L[i*2+1]=b[i]
L[len(a)*2]=a[-1]

if len(a)>len(b):
  del L[len(a)*2+1]
else:
  L[-1]=b[-1]

print("".join(L))
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
p = list(map(int, input().split()))
for d in range(x + 1):
    for s in [-1, +1]:
        a = x + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, inpot().split()))
for d in range(x + 1):
    for s in [-1, +1]:
        a = x + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)
Problem p02742 (python)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
  
else:
  print((h*w+1)//2)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h==1||w==1:
  print(1)
  
else:
  print((h*w+1)//2)
Problem p02743 (python)

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

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