Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import itertools
N,C = map(int,input().split())
imos = [0]*(50)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)

Fixed submission:
import itertools
N,C = map(int,input().split())
imos = [0]*(10**6)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
N,C = map(int,input().split())
imos = [0]*(50)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
print(imos)
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)

Fixed submission:
import itertools
N,C = map(int,input().split())
imos = [0]*(10**6)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N[0] == N[1] == N[2] and N[1] == N[2] == N[3]:
  print("Yes")
else:
  print("No")

Fixed submission:
N = input()
if N[0] == N[1] == N[2]:
  print("Yes")
elif N[1] == N[2] == N[3]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N,K;
    cin >> N >> K;
    // 初期値とKを比較 小さい方を足す
    int num = 1;
    for (int i = 0; i < N; i++) {
        if (num <= K) {
            num *= 2;
        }
        else {
            num += K;
        }
    }
    cout << num << endl;
}

Fixed submission:
N,K = [int(input()) for i in range(2)]
p = 1
for i in range(N):
  p = min(2*p,p+K)
print(p)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]

nA = [line[:] for line in A]
cnt = 0

for k in range(N):
    for i in range(N):
        for j in range(N):
            if nA[i][j] > nA[i][k] + nA[k][j]:
                nA[i][j] = nA[i][k] + nA[k][j]
            elif not(i == j or j == k or k == i) and nA[i][j] == nA[i][k] + nA[k][j]:
                cnt += nA[i][j]

if A != nA:
    print(-1)
else:
    ans = sum(sum(line) for line in A) - cnt
    ans //= 2
    print(ans)

Fixed submission:
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]

flag = [[0] * N for _ in range(N)]
dist = [line[:] for line in A]

for k in range(N):
    for i in range(N):
        for j in range(N):
            if i == j or j == k or k == i:
                continue
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]
            elif dist[i][j] < dist[i][k] + dist[k][j]:
                flag[i][j] += 1

if A != dist:
    print(-1)
    exit()

ans = 0
for i in range(N):
    for j in range(N):
        if flag[i][j] == N-2:
            ans += A[i][j]

ans //= 2
print(ans)
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
A = abs(x-a)
B = abs(x-b)
if A<B:
  print("A")
else;
  print("B")

Fixed submission:
x,a,b = map(int,input().split())
A = abs(x-a)
B = abs(x-b)
if A<B:
  print("A")
else:
  print("B")
Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
T = [int(input()) for i in range(N)]
T = list(set(T))
pro = T[0]
for i in range(1,len(T)):
    gcd = fractions.gcd(pro,T[i])
    lcm = (pro * T[i]) // gcd
    pro = lcm
print(lcm)

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
T = [int(input()) for i in range(N)]
def lcm(x,y):
    return (x * y) // gcd(x,y)
ans = reduce(lcm,T)
print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
T = [int(input()) for i in range(N)]
T = list(set(T))
pro = T[0]
for i in range(1,N):
    gcd = fractions.gcd(pro,T[i])
    lcm = (pro * T[i]) // gcd
    pro = lcm
print(lcm)

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
T = [int(input()) for i in range(N)]
def lcm(x,y):
    return (x * y) // gcd(x,y)
ans = reduce(lcm,T)
print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
T = [int(input()) for i in range(N)]
pro = T[0]
for i in range(1,N):
    gcd = fractions.gcd(pro,T[i])
    lcm = (pro * T[i]) // gcd
    pro = lcm
print(lcm)

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
T = [int(input()) for i in range(N)]
def lcm(x,y):
    return (x * y) // gcd(x,y)
ans = reduce(lcm,T)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
l,B_s,B_l = [],[],[]
for i in range(M):
    a,b = map(int,input().split())
    if a == 1 :
        if b < N:
            B_s.append(b)
        elif b > N:
            B_l.append(b)        
    l.append([a,b])
for e in l:
    if e[0] in B_s and e[1] == N:
        print("POSSIBLE")
        break
    elif e[1] in B_l and e[0] == N:
        print("POSSIBLE")
        break
    elif e == l[-1]:
        print("IMPOSSIBLE")

Fixed submission:
N,M = map(int,input().split())
l_s,l_l,B_s,B_l = [],[],[],[]
for i in range(M):
    a,b = map(int,input().split())
    if a == 1 :
        if b < N:
            B_s.append(b) #Nより小さい
        elif b > N:
            B_l.append(b) #Nより大きい
    if a == N:
        l_l.append(b) #Nより大きい
    elif b == N:
        l_s.append(a) #Nより小さい
common_1 = len(list(set(l_s) & set(B_s)))
common_2 = len(list(set(l_l) & set(B_l)))
if common_1 > 0 or common_2 > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
l,B = [],[]
for i in range(M):
    a,b = map(int,input().split())
    if a == 1 :
        B.append(b)
    l.append([a,b])
for e in l:
    if e[0] in B and e[1] == N:
        print("POSSIBLE")
        break
    elif e[1] in B and e[0] == N:
        print()("POSSIBLE")
        break
    elif e == l[-1]:
        print("IMPOSSIBLE")

Fixed submission:
N,M = map(int,input().split())
l_s,l_l,B_s,B_l = [],[],[],[]
for i in range(M):
    a,b = map(int,input().split())
    if a == 1 :
        if b < N:
            B_s.append(b) #Nより小さい
        elif b > N:
            B_l.append(b) #Nより大きい
    if a == N:
        l_l.append(b) #Nより大きい
    elif b == N:
        l_s.append(a) #Nより小さい
common_1 = len(list(set(l_s) & set(B_s)))
common_2 = len(list(set(l_l) & set(B_l)))
if common_1 > 0 or common_2 > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))

b = []
for a in A:
    b.append(a)
    b.reverse()

print(*b)

Fixed submission:
from collections import deque
n = int(input())
A = list(map(int,input().split()))

b = deque()
for i,a in enumerate(A):
    if i % 2 == 0:
        b.append(a)
    elif i % 2 == 1:
        b.appendleft(a)

if n % 2 == 1:
    b.reverse()
print(*b)
Buggy python submission (verdict: Runtime Error):
r,g,b = map(int,input().split())
if (10*g + b) % 4 = 0:
  print("YES")
else:
  print("NO")

Fixed submission:
r,g,b = map(int,input().split())
if (10*g + b) % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
r,g,b = map(int,input().split())
if (10*g + b) % 4 = 0:
  print("YES")
else:
  print("No")

Fixed submission:
r,g,b = map(int,input().split())
if (10*g + b) % 4 == 0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left

class SegmentTree:
    def __init__(self, N):
        self.N = 2 * pow(2, N.bit_length()) - 1
        self.data = [0 for _ in range(2*self.N)]
    
    def update(self, k, x):
        k += self.N-1
        self.data[k] = x
        while k >= 0:
            k = (k - 1) // 2
            self.data[k] = sum([self.data[2*k+1], self.data[2*k+2]])
    
    # [l,r)
    def query(self, l, r):
        L = l + self.N
        R = r + self.N
        s = 0
        while L < R:
            if R & 1:
                R -= 1
                s = sum([s, self.data[R-1]])
            if L & 1:
                s = sum([s, self. data[L-1]])
                L += 1
            L >>= 1; R >>= 1
        return s

    def node(self, k):
        return st.query(k, k+1)

def compress(arr):
    N = len(arr)
    narr = sorted(arr)
    pressed = [-1] * N
    for i in range(N):
        pressed[i] = bisect_left(narr, arr[i])
    return pressed
    

def accmulate(arr):
    N = len(arr)
    cs = [0]*(N+1)
    for i in range(N):
        cs[i+1] = cs[i] + arr[i]
    return cs

# [l,r)
def query(cs, l, r):
    return cs[r] - cs[l]

N, K = map(int,input().split())
A = [int(input()) - K for _ in range(N)]

cs = accmulate(A)
cs = compress(cs)
st = SegmentTree(N)

ans = 0

for i in range(N+1):
    ans += st.query(0, cs[i] + 1)
    st.update(cs[i], st.node(cs[i]) + 1)

print(ans)

Fixed submission:
from bisect import bisect_left

class SegmentTree:
    def __init__(self, N):
        self.N = 2 * pow(2, N.bit_length()) - 1
        self.data = [0 for _ in range(2*self.N)]
    
    def update(self, k, x):
        k += self.N-1
        self.data[k] = x
        while k >= 0:
            k = (k - 1) // 2
            self.data[k] = sum([self.data[2*k+1], self.data[2*k+2]])
    
    # [l,r)
    def query(self, l, r):
        L = l + self.N
        R = r + self.N
        s = 0
        while L < R:
            if R & 1:
                R -= 1
                s = sum([s, self.data[R-1]])
            if L & 1:
                s = sum([s, self. data[L-1]])
                L += 1
            L >>= 1; R >>= 1
        return s

    def node(self, k):
        return st.query(k, k+1)

def compress(arr):
    N = len(arr)
    narr = sorted(arr)
    pressed = [-1] * N
    for i in range(N):
        pressed[i] = bisect_left(narr, arr[i])
    return pressed
    

def accmulate(arr):
    N = len(arr)
    cs = [0]*(N+1)
    for i in range(N):
        cs[i+1] = cs[i] + arr[i]
    return cs

# [l,r)
def query(cs, l, r):
    return cs[r] - cs[l]

N, K = map(int,input().split())
A = [int(input()) - K for _ in range(N)]

cs = accmulate(A)
cs = compress(cs)
st = SegmentTree(N)

ans = 0

for i in range(N+1):
    ans += st.query(0, cs[i] + 1)
    st.update(cs[i], st.node(cs[i]) + 1)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())
array = []
for i in range(N):
    a,b = map(int,input().split())
    array += [a] * b
array.sort()
ans = array[K-1]
print(ans)

Fixed submission:
N, K = map(int,input().split())
info = [list(map(int,input().split())) for i in range(N)]
info.sort()
count = 0
for e in info:
    count += e[1]
    if count >= K:
        ans = e[0]
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
inf = float('inf')

# distの初期化: dist = [inf for _ in range(N)]; dist[start] = 0
# True - >正常に更新, False -> 負閉路有り
def bellmanford(dist,edges,N):
    for i in range(N):
        for v ,nv, w in edges:
            if dist[nv] > dist[v] + w:
                dist[nv] = dist[v] + w
                # 頂点数Nなら更新は高々N-1回で済む
                # N回目に更新を行うなら負閉路があるということ
                if i == N-1 nv == N-1:
                    return False
    return True

N,M = map(int,input().split())
info = []
for _ in range(M):
    a,b,c = map(int,input().split())
    a -= 1; b -= 1; c = -c
    info.append((a,b,c))
 
dist = [inf for _ in range(N)]
dist[0] = 0

flag = bellmanford(dist,info,N)
ans = -dist[N-1] if flag is True else "inf"
print(ans)

Fixed submission:
inf = float('inf')

N,M = map(int,input().split())
info = []
for _ in range(M):
    a,b,c = map(int,input().split())
    a -= 1; b -= 1
    info.append((a,b,c))
 
dist = [-inf for _ in range(N)]
dist[0] = 0
for i in range(N):
    for v,nv,w in info:
        if dist[nv] < dist[v] + w:
            dist[nv] = dist[v] + w
            if i == N-1 and nv == N-1:
                print("inf")
                exit()
ans = dist[N-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N,W = map(int,input().split())
    info = []
    for i in range(N):
        w,v = map(int,input().split())
        if i == 0:
            w1 = w
        w = w - (w1-1)
        info.append((w,v))
    # dp[i][j][k]
    # dp[i][j][k] = max(dp[i-1][j][k],dp[i-1][j-w][k-1])
    # dp[0][j][0] = 0
    # ans = max(dp[N][j][k] w1*k + j <= W)
    dp = [[[0]*(N+1) for _ in range(400)] for _ in range(N+1)]
    for i in range(1,N+1):
        w = info[i-1][0]; v = info[i-1][1]
        for j in range(400):
            for k in range(1,N+1):
                dp[i][j][k] = dp[i-1][j][k]
                if j - w >= 0:
                    if dp[i][j][k] < dp[i-1][j-w][k-1] + v:
                        dp[i][j][k] = dp[i-1][j-w][k-1] + v

    ans = -1
    for k in range(N+1):
        for j in range(W-(w1-1)*k + 1):
            if dp[N][j][k] > ans:
                ans = dp[N][j][k]
    print(ans)

main()

Fixed submission:
import sys
input = sys.stdin.readline

N,W = map(int,input().split())
info = []
for i in range(N):
    w,v = map(int,input().split())
    if i == 0:
        w1 = w
    w = w - (w1-1)
    info.append((w,v))
# dp[i][j][k]
# dp[i][j][k] = max(dp[i-1][j][k],dp[i-1][j-w][k-1])
# dp[0][j][0] = 0
# ans = max(dp[N][j][k] w1*k + j <= W)
dp = [[[0]*(N+1) for _ in range(400)] for _ in range(N+1)]
for i in range(1,N+1):
    w = info[i-1][0]; v = info[i-1][1]
    for j in range(400):
        for k in range(1,N+1):
            dp[i][j][k] = dp[i-1][j][k]
            if j - w >= 0:
                if dp[i][j][k] < dp[i-1][j-w][k-1] + v:
                    dp[i][j][k] = dp[i-1][j-w][k-1] + v
ans = -1
for j in range(400):
    for k in range(N+1):
        if not((w1-1)*k + j <= W):
            continue
        if dp[N][j][k] > ans:
            ans = dp[N][j][k]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
ans  = 0
for i in range(N):
    A.pop(-1)
    ans += A.pop(-1)
    A.pop(0)
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
A.reverse()
ans  = 0
for i in range(1,2*N + 1,2):
    ans += A[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
def bfs(position=[0],depth=1):
    queue = []
    for p in position:
        for dx in [-depth,0,depth]:
            nextp = p + dx
            if nextp == X:
                return depth
            queue.append(nextp)
    position = queue[:]
    if depth == 10**5:
        return depth
    return bfs(position,depth+1)
print(bfs())

Fixed submission:
X = int(input())
for t in range(1,X+1):
    if t*(t+1)//2 >= X:
        print(t)
        break
Buggy python submission (verdict: Time Limit Exceeded):
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
def func(list1,num = 1):
    for i in range(1,len(list1)):
        wait = list1[i] - list1[0]
        if wait > K or i + 1 > C:
            return func(list1[i:],num + 1)
    return num
print(func(T))

Fixed submission:
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
num = 1
begin = 0
for j in range(100000):
    for i in range(begin + 1,N):
        wait = T[i] - T[begin]
        if wait > K or i - begin + 1> C:
            num += 1
            begin = i
            break
    else:
        break
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
def func(list1,num = 1):
    for i in range(len(list1)):
        wait = list1[i] - list1[0]
        if wait > K or i + 1 > C:
            return func(list1[i:],num + 1)
    return num
print(func(T))

Fixed submission:
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
num = 1
begin = 0
for j in range(100000):
    for i in range(begin + 1,N):
        wait = T[i] - T[begin]
        if wait > K or i - begin + 1> C:
            num += 1
            begin = i
            break
    else:
        break
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
power = 1
for i in range(1,N+1):
    power *= i
ans = power % (10**9 + 7)
print(ans)

Fixed submission:
N = int(input())
power = 1
for i in range(1,N+1):
    power *= i
    power %= 10**9 + 7
print(power)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline

    inf = float('inf')

    N,Ma,Mb = map(int,input().split())

    # dp[i][j][k]: i番目までみてj(g), k(g)となるような最小予算
    dp = [[[inf]*401 for _ in range(401)] for _ in range(N+1)]
    dp[0][0][0] = 0

    for i in range(N):
        a,b,c = map(int,input().split())
        for j in range(401):
            for k in range(401):
                dp[i+1][j][k] = dp[i][j][k]
                if j - a >= 0 and k - b >= 0 and dp[i+1][j][k] > dp[i][j-a][k-b] + c:
                    dp[i+1][j][k] = dp[i][j-a][k-b] + c

    ans = inf

    for j in range(1,401):
        for k in range(1,401):
            if j * Mb == Ma * k and ans > dp[N][j][k]:
                ans = dp[N][j][k]

    if ans == inf:
        ans = -1
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
input = sys.stdin.readline

inf = float('inf')

N,Ma,Mb = map(int,input().split())

# dp[i][j][k]: i番目までみてj(g), k(g)となるような最小予算
dp = [[[inf]*401 for _ in range(401)] for _ in range(N+1)]
dp[0][0][0] = 0

for i in range(N):
    a,b,c = map(int,input().split())
    for j in range(401):
        for k in range(401):
            dp[i+1][j][k] = dp[i][j][k]
            if j - a >= 0 and k - b >= 0 and dp[i+1][j][k] > dp[i][j-a][k-b] + c:
                dp[i+1][j][k] = dp[i][j-a][k-b] + c

ans = inf

for j in range(1,401):
    for k in range(1,401):
        if j * Mb == Ma * k and ans > dp[N][j][k]:
            ans = dp[N][j][k]

if ans == inf:
    ans = -1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

inf = float('inf')

N,Ma,Mb = map(int,input().split())
abc = [list(map(int,input().split())) for _ in range(N)]

# dp[i][j][k]: i番目までみてj(g), k(g)となるような最小予算
dp = [[[inf]*401 for _ in range(401)] for _ in range(N+1)]
dp[0][0][0] = 0

for i in range(N):
    a,b,c = abc[i]
    for j in range(401):
        for k in range(401):
            if j - a >= 0 and k - b >= 0:
                dp[i+1][j][k] = min(dp[i][j][k], dp[i][j-a][k-b] + c)
            else:
                dp[i+1][j][k] = dp[i][j][k]

ans = inf

for j in range(1,401):
    for k in range(1,401):
        G = gcd(j,k)
        if (j//G, k//G) == (Ma, Mb):
            ans = min(ans, dp[N][j][k])

if ans == inf:
    ans = -1
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

inf = float('inf')

N,Ma,Mb = map(int,input().split())

# dp[i][j][k]: i番目までみてj(g), k(g)となるような最小予算
dp = [[[inf]*401 for _ in range(401)] for _ in range(N+1)]
dp[0][0][0] = 0

for i in range(N):
    a,b,c = map(int,input().split())
    for j in range(401):
        for k in range(401):
            dp[i+1][j][k] = dp[i][j][k]
            if j - a >= 0 and k - b >= 0 and dp[i+1][j][k] > dp[i][j-a][k-b] + c:
                dp[i+1][j][k] = dp[i][j-a][k-b] + c

ans = inf

for j in range(1,401):
    for k in range(1,401):
        if j * Mb == Ma * k and ans > dp[N][j][k]:
            ans = dp[N][j][k]

if ans == inf:
    ans = -1
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
t = x // 11
x -= 11 * t
ans = t * 2
if x <= 5:
    ans += 1
elif 5 < x < 11:
    ans += 2
print(ans)za

Fixed submission:
x = int(input())
if x % 11 == 0:
    r = 0
elif x % 11 <= 6:
    r = 1
else:
    r = 2
ans = 2 * (x // 11) + r
print(ans)
Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - (i+j) <= K:
            count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - (i+j) <= K:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i + j + k == S:
                count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - (i+j) <= K:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x == y:
    ans = 0
elif 0 <= x < y:
    ans = y - x
elif 0 <= y < x:
    if y == 0:
        ans = 1 + x 
    else:
        ans = 1 - y + x + 1
elif x < y <= 0:
    ans = y - x
elif y < x <= 0:
    if x == 0:
        ans = - y + 1
    else:
        ans = 1 - y + x + 1
elif x < y:
    if abs(x) < abs(y):
        ans = 1 + y + x
    elif abs(x) > abs(y):
        ans = - y - x + 1
elif y < x:
    if abs(x) < abs(y):
        ans = - y - x + 1
    elif abs(x) > abs(y):
        ans = 1 + y + x
print(ans)

Fixed submission:
x,y = map(int,input().split())
if x == y:
    ans = 0
elif 0 <= x < y:
    ans = y - x
elif 0 <= y < x:
    if y == 0:
        ans = 1 + x 
    else:
        ans = 1 - y + x + 1
elif x < y <= 0:
    ans = y - x
elif y < x <= 0:
    if x == 0:
        ans = - y + 1
    else:
        ans = 1 - y + x + 1
elif x < y:
    if abs(x) <= abs(y):
        ans = 1 + y + x
    elif abs(x) > abs(y):
        ans = - y - x + 1
elif y < x:
    if abs(x) <= abs(y):
        ans = - y - x + 1
    elif abs(x) > abs(y):
        ans = 1 + y + x
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
str_list = ["eraser","erase","dreamer","dream"]
for e in str_list:
    s = s.replace(e)
ans = "YES" if s == "" else "NO"
print(ans)

Fixed submission:
s = input()
str_list = ["dream","dreamer","erase","eraser"]
for i in range(len(s) // 5):
    if s[-7:] == "dreamer":
        s = s[:-7]
    elif s[-6:] == "eraser":
        s = s[:-6]
    elif s[-5:] == "dream" or s[-5:] == "erase":
        s = s[:-5]
ans = "YES" if s == "" else "NO"
print(ans)