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

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
value = min(a) + min(b)
for i in range(M):
    x,y,c = list(map(int, input().split()))
    if a[x-1] + b[y-1] - c < value:
        value = a[x-1] + b[y-1] - c

print(value)

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
value = min(a) + min(b)
for i in range(M):
    x,y,c = list(map(int, input().split()))
    if A[x-1] + B[y-1] - c < value:
        value = A[x-1] + B[y-1] - c

print(value)

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
value = min(a) + min(b)
for i in range(M):
    x,y,c = list(map(int, input().split()))
    if A[x-1] + B[y-1] - c < value:
        value = A[x-1] + B[y-1] - c

print(value)

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
value = min(a) + min(b)
for i in range(M):
    x,y,c = list(map(int, input().split()))
    if A[x] + B[y] - c < value:
        value = A[x] + B[y] - c

print(value)
Problem p02756 (python)

Fixed submission:
# import bisect
# import heapq
# from copy import deepcopy
from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math

# n, k = map(int, input().split())
# a = list(map(int, input().split()))
s = deque(input())
q = int(input())
rev = False
for i in range(q):
    que = input()
    if que[0] == '1':
        rev = not rev
    else:
        que = list(que.split())
        if (int(que[1])==1 and not rev) or (int(que[1])==2 and rev):
            s.appendleft(que[2])
        else:
            s.append(que[2])

if rev: ans = ''.join(reversed(s))
else: ans = ''.join(s)
print(ans)

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

s = deque(input())
q = int(input())
rev = False
for i in range(q):
    que = input()
    if que[0] == '1':
        rev = not rev
    else:
        que = list(que.split())
        if (int(que[1])==1 and not rev) or (int(que[1])==2 and rev):
            s.appendleft(que[2])
        else:
            s.append(que[2])

if rev: ans = ''.join(s[::-1])
else: ans = ''.join(s)
print(ans)

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math

# n, k = map(int, input().split())
# a = list(map(int, input().split()))
s = deque(input())
q = int(input())
rev = False
for i in range(q):
    que = input()
    if que[0] == '1':
        rev = not rev
    else:
        que = list(que.split())
        if (int(que[1])==1 and not rev) or (int(que[1])==2 and rev):
            s.appendleft(que[2])
        else:
            s.append(que[2])

if rev: ans = s[::-1]
else: ans = s
print(ans)

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

s = deque(list(input()))
q = int(input())

for i in range(q):
    que = input().split()
    if que[0] == 1:
        S.reverse()
        
    else:
        if que[1]==1:
            S.appendleft(que[-1])
        else: S.append(que[-1])
        
ans = "".join(S)
print(ans)

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

s = deque(input())
q = int(input())

for i in range(q):
    que = input().split()
    if que[0] == 1:
        S.reverse()
        
    else:
        if que[1]==1:
            S.appendleft(que[-1])
        else: S.append(que[-1])
        
S = "".join(S)
print(S)
Problem p02761 (python)

Fixed submission:
# import math
# import bisect
# import heapq
# from collections import deque
import numpy as np

n, m = map(int, input().split())
s, c = [0] * m, [0] * m
for i in range(m):
    s[i], c[i] = map(int, input().split())

# replace = [False] * n
number = ['a'] * n
ans = 0
for i in range(m):

    if number[s[i]-1] != 'a' and str(c[i]) != number[s[i]-1]:
        ans = -1
        break

    number[s[i]-1] = str(c[i])

if not ans == -1:
    for i in range(n):
        if i == 0 and number[i] == 'a' and len(number) != 1:
            number[0] = '1'
        elif number[i] == 'a':
            number[i] = '0'
    ans = ''.join(number)

    if n != 1 and number[0] == '0':
        ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
# import math
# import bisect
# import heapq
# from collections import deque
import numpy as np

n,m = map(int,input().split())
s,c = [0] * m, [0] * m
for i in range(m):
    s[i],c[i] = map(int,input().split())

# replace = [False] * n
ans = list('a'* n)

for i in range(m):


    if ans[s[i]-1] != 'a' and str(c[i]) != ans[s[i]-1]:
        ans = -1
        break

    ans[s[i]-1] = str(c[i])

if not ans == -1:

    for i in range(n):
        if i == 0 and ans[i] == 'a': ans[0] = '1'
        elif ans[i] == 'a': ans[i] = '0'

    print(''.join(ans))

elif len(ans) != 1 and ans[0] == 0 : print(-1)

Buggy submission (verdict: Runtime Error):
# import math
# import bisect
# import heapq
# from collections import deque
import numpy as np

n,m = map(int,input().split())
s,c = [0] * m, [0] * m
for i in range(m):
    s[i],c[i] = map(int,input().split())

# replace = [False] * n
ans = list('a'* n)

for i in range(m):

    if len(ans) != 1 and s[i] == 1 and c[i] == 0:
        ans = -1
        break
    elif ans[s[i]-1] != 'a' and str(c[i]) != ans[s[i]-1]:
        ans = -1
        break

    ans[s[i]-1] = str(c[i])
if n == 1 and ans[0] == 0: print(0)

elif not ans == -1:

    for i in range(n):
        if i == 0 and ans[i] == 'a': ans[0] = '1'
        elif ans[i] == 'a': ans[i] = '0'

    print(''.join(ans))

elif : print(-1)
Problem p02780 (python)

Fixed submission:
N,K = map(int, input().split())
P = list(map(int, input().split()))
S=0
for i in range(K):
    S += (P[i]+1)/2.
ans = S
for i in range(N-K):
    S += (P[i+K]-P[i])/2.
    ans = S if S > ans else ans 

print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int, input().split()))
S=0
for i in range(K):
    S += (P[i]+1)/2.
ans = S
for i in range(N-K)
    S += (P[i+k]-P[i])/2.
    ans = S if S>ans 

print(ans)

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

for i in range(K):
    S += (P[i]+1)/2
ans = S
for i in range(N-K)
    S += (P[i+k]-P[i])/2
    ans = S if S>ans 

print(ans)
Problem p02783 (python)

Fixed submission:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

h,a = map(int, input().split())
# n = int(input())
# a = list(map(int,input().split()))
if h % a ==0: ans = h // a
else: ans = h // a + 1

print(ans)

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7

# n = int(input())
h, n = map(int, input().split())
# a = list(map(int, input().split()))
a, b = [0] * n, [0] * n

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

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

for i in range(n):

    for j in range(h):

        dp[min(j+a[i], h)] = min(dp[min(j+a[i],h)], dp[j]+b[i])


print(dp[h])
Problem p02787 (python)

Fixed submission:
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7

# n = int(input())
h, n = map(int, input().split())
# a = list(map(int, input().split()))
a, b = [0] * n, [0] * n

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

dp = [10**9+7] * (h+1)
dp[0] = 0

for i in range(n):

    for j in range(h):

        dp[min(j+a[i], h)] = min(dp[min(j+a[i],h)], dp[j]+b[i])


print(dp[h])

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
mod = 10**9 + 7

# n = int(input())
h, n = map(int, input().split())
# a = list(map(int, input().split()))
a, b = [0] * n, [0] * n

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

dp = [math.inf] * (h+1)
dp[0] = 0

for i in range(n):

    for j in range(h):

        dp[min(j+a[i], h)] = min(dp[min(j+a[i],h)], dp[j]+b[i])


print(dp[h])

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
mod = 10**9 + 7

# n = int(input())
h, n = map(int, input().split())
# a = list(map(int, input().split()))
a, b = [0] * n, [0] * n

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

dp = [-1] * (h+1)
dp[0] = [0]


for i in range(n):
    for j in range(h):
        dp[min(j+a[i], h)] = min(dp[min(j+a[i], h)], dp[j] + b[i])


print(dp[h])
Problem p02801 (python)

Fixed submission:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

# a,b = map(int, input().split())
# n = int(input())
# p = list(map(int,input().split()))
c=input()


print(chr(ord(c) + 1))

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math

n, k = map(int, input().split())
a = list(map(int, input().split()))
# n = int(input())
mod = 10 ** 9 + 7
a.sort(reverse = True)
# print(a)
ans = 0

def C(n, k, mod):
    if n == 0 and k == 0:
        return 1
    if n < k or k < 0:
        return 0
    x,y = 1,1
    while k > 0:
        x *= n
        y *= k
        n, k = n-1, k-1
        
    return x * pow(y, mod-2, mod) % mod


for i in range(0,n-k+1):
    ans += a[i] * C(n-i-1, k-1, mod)
    ans %= mod

a.reverse()
for i in range(0, n - k + 1):
    ans -= a[i] * C(n - i - 1, k - 1, mod)
    ans %= mod



print(ans)
Problem p02811 (python)

Fixed submission:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

k,x = map(int, input().split())
# n = int(input())
# a = list(map(int,input().split()))
ans = 'No'
if 500 * k >= x : ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
# import math
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
from itertools import permutations
# import numpy as np


# k,x = map(int, input().split())

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
m = [i + 1 for i in range(n)]
c = 0
for i in permutations(m):
    c += 1
    # print(i)
    if list(i) == p:
        a = c
    if list(i) == q:
        b = c
print(abs(a - b))

Buggy submission (verdict: Runtime Error):
# import math
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np


# k,x = map(int, input().split())

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
m = [i + 1 for i in range(n)]
c = 0
for i in permutations(m):
    c += 1
    # print(i)
    if list(i) == p:
        a = c
    if list(i) == q:
        b = c
print(abs(a - b))
Problem p02848 (python)

Fixed submission:
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7

# n = int(input())
# a = list(map(int, input().split()))
n = int(input())
s = input()
ans = []
for i in s:
    ans.append(chr((ord(i)-ord('A')+n)%26 + ord('A')))

print(''.join(ans))

Buggy submission (verdict: Runtime Error):
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
mod = 10**9 + 7

# n = int(input())
# a = list(map(int, input().split()))
n = int(input())
s = input()
ans = []
for i in range(s):
    ans.append(chr((ord(i)-ord('A')+n)%26 + ord('A')))

print(''.join(ans))
Problem p02885 (python)

Fixed submission:
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
# mod = 10**9 + 7

# n = int(input())
# a = list(map(int, input().split()))
# n = int(input())z
a,b = map(int,input().split())


print(a-2*b if a-2*b>=0 else 0)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        ans += c - 1 - b
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        	ans += c - 1 - b
print(ans)

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

ls.sort()

dis = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if ls[i] + ls[j] <= ls[k]: dis += 1

ans = (n*(n-1)*(n-2) // 6) - dis
print(ans)
Problem p02888 (python)

Fixed submission:
from sys import stdin
import bisect
n = int(input())
ls = list(map(int,input().split()))
ls.sort()
 
ans = 0
for a in range(n-2):
    for b in range(a + 1, n-1):
        c = bisect.bisect_left(ls, ls[a] + ls[b])
 
        ans += c - 1 - b
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])
        	ans += c - 1 - b
 
print(ans)
Problem p02923 (python)

Fixed submission:
import math 
import bisect
import heapq
from collections import deque

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

l = [0] * n
l[0] = 0
for i in range(1,n):
    l[i] = l[i-1] + 1 if h[i-1] >= h[i] else 0

print(max(l))

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

n = int(input())
h = map(int,input().split())

l = [0] * n
l[0] = 0
for i in range(1,n):
    l[i] = l[i-1] + 1 if h[i-1] >= h[i] else 0

print(max(l))

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

n = int(input())
h = map(int,input().split())

l = [0] * n
l[0] = 0
for i in range(1,n):
    l[i] = l[i-1] + 1 if h[i-1] >= h[i] else 0

print(max(l))
Problem p02924 (python)

Fixed submission:
import math 
import bisect
import heapq
from collections import deque

n = int(input())
print(n*(n-1) // 2)

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

n = int(input())
print(n(n-1) //2)
Problem p02936 (python)

Fixed submission:
import math 
import bisect
import heapq
from operator import mul
from collections import deque

n, q = map(int, input().split())
g=[[] for _ in range(n)]

for i in range(n-1):
    a,b=map(int,input().split())
    g[a-1].append(b-1)
    g[b - 1].append(a - 1)
c = [0] * n

for j in range(q):
    p, x = map(int, input().split())
    c[p - 1] += x

seen = [0] * n
seen[0] = 1
next = deque([0])


while next:
    v = next.popleft()
    cost = c[v]

    for nv in g[v]:

        if seen[nv]:
            continue
        seen[nv] = 1
        next.append(nv)
        c[nv] += cost

print(*c)

Buggy submission (verdict: Runtime Error):
import math 
import bisect
import heapq
from operator import mul
from collections import deque

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)]



def dfs(start):
    if start == 1:
        return [True] * n
    task = deque([])
    seen = [False] * n

    task.appendleft(start)
    seen[start-1] = True

    while task:
        task.popleft()
        for i in range(len(ab)):
            if ab[i][0] == start and seen[ab[i][1]-1] == False:
                next = ab[i][1]
                seen[next-1] = True
                task.appendleft(next)


    return seen


ans = [0]*n

for i in range(q):
    for j in range(n):
        ans[j] += px[i][1] if dfs(px[i][0])[j] else 0
for i in range(len(ans))
print(ans[i])
Problem p03160 (python)

Fixed submission:
import math
import bisect
import heapq
from collections import deque

n = int(input())

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

d = [float('inf')] * n
d[0] = 0
d[1] = abs(h[0] - h[1])

for i in range(2,n):
    d[i] = min(d[i-1] + abs(h[i-1]-h[i]), d[i-2] + abs(h[i-2]-h[i]))

print(d[n-1])

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

n = int(input())

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

d = [math.inf] * n
d[0] = 0
d[1] = abs(h[0] - h[1])

for i in range(2,n):
    d[i] = min(d[i-1] + abs(h[i-1]-h[i]), d[i-2] + abs(h[i-2]-h[i]))

print(d[n-1])

Buggy submission (verdict: Runtime Error):
import math
import bisect
import heapq
from fractions import gcd #math in python 3.7
from collections import deque

n = int(input())

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

d = [math.inf] * n
d[0] = 0
d[1] = abs(h[0] - h[1])

for i in range(2,n):
    d[i] = min(d[i-1] + abs(h[i-1]-h[i]), d[i-2] + abs(h[i-2]-h[i]))

print(d[n-1])
Problem p02613 (python)

Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(input())
print('AC x ' + str(a.count('AC')))
print('WA x ' + str(a.count('WA')))
print('TLE x ' + str(a.count('TLE')))
print('RE x ' + str(a.count('RE')))

Buggy submission (verdict: Runtime Error):
n = int(intput())
a = []
for i in range(n):
  a.append(input())
print('AC x ' + str(a.count('AC')))
print('WA x ' + str(a.count('WA')))
print('TLE x ' + str(a.count('TLE')))
print('RE x ' + str(a.count('RE')))
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p = p.sort()
print(sum(p[:k]))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input())*int(input()))
Problem p02717 (python)

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

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

Fixed submission:
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.reverse()
a = sum(l)
for i in range(m):
  if l[i]/a < 1/(4*m):
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sorted()
if min(l[m-1]) < 1/(4*m):
  print('No')
else:
  print('Yes')
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
x = 0
while h > 0:
  h -= a
  x += 1

else:
  print(x)

Buggy submission (verdict: Runtime Error):
h, a = map(int, input().split())
h1 = h
x = 0
while h1 <= 0:
  h1 -= a
  x++
print(x)
Problem p02789 (python)

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

if N == M:
  print('Yes')
else:
  print('No')

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

if N == M:
  print('Yes')
else:
  print('No')

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

if N == M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
if N == M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
If N ==M:
  print('Yes')
else print('No')
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t + s)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print(t+s)
Problem p02910 (python)

Fixed submission:
a = input()
for i in range(1,len(a)+1):
  if i%2 == 0:
    if a[i-1] == 'R':
      print('No')
      exit()
  else:
    if a[i-1] =='L':
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
a = input()
for i in range(len(1,a+1)):
  if i%2 == 0:
    if a[i] == 'R':
      print('No')
      exit()
  else:
    if a[i] =='L':
      print('No')
      exit()
print('Yes')
Problem p02934 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[i])
c = sum(b)
print(1/c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[n])
c = sum(b)
print(1/c)
Problem p02946 (python)

Fixed submission:
k, x = map(int,input().split())
a = []
for i in range(-k+x+1, k+x):
  a.append(str(i))
print(' '.join(a))

Buggy submission (verdict: Runtime Error):
k, x = map(int,input().split())
a = []
for i in range(-k+x+1, k+x):
  a.append(i)
print(' '.join(a))
Problem p02952 (python)

Fixed submission:
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))

Buggy submission (verdict: Runtime Error):
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900b+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))
Problem p02958 (python)

Fixed submission:
a = int(input())
l = list(map(int, input().split()))
x = sorted(l)
b =0
for i in range(a):
  if x[i] !=l[i]:
    b +=1
if b ==2 or b ==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a = int(input())
l = list(map(int, input().split()))
x = l.sorted()
for i in range(a):
  if x[i] ==l[i]:
    b +=1
if b ==2:
  print('YES')
else:
  print('NO')
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
a, b , c = map(input().split())
print(min(a*b, c))
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
s = []
for i in range(N):
  s.append(i+L)
t = list(map(abs, s))
del s[t.index(min(t))]
print(sum(s))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
s = []
for i in N:
  s.append(i+L)
t = abs(s)
del s[t.index(min(s))]
print(sum(s))
Problem p03071 (python)

Fixed submission:
a, b = map(int, input().split())
c = 0
for i in range(2):
  if a>b:
    c += a
    a -= 1
  else:
    c += b
    b -= 1
print(c)

Buggy submission (verdict: Runtime Error):
a, b = map(input().split())
c = 0
for i in range(2):
  if a>b:
    c += a
    a -= 1
  else:
    c += b
    b -= 1
print(c)