Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    MOD = 10**9 + 7
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    
    a_sum = []
    for i in range(n):
        a_sum.append(sum(a[i+1:n]))
    
    for i in range(n-1):
        ans += a[i] * a_sum[i]
        ans %= MOD
    print(ans)
        
        
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    MOD = 10**9 + 7
    n = int(input())
    a = list(map(int, input().split()))
    a_sum = sum(a)
    ans = 0
    
    for i in range(n):
        ans += a[i] * (a_sum - a[i])
    print(ans // 2 % MOD)
        
        
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    mod = 10**9 + 7
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    
    for i in range(0, n-1):
        for j in range(i+1, n):
            ans = (ans + (a[i] * a[j])) % mod
    print(ans)
        
        
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    MOD = 10**9 + 7
    n = int(input())
    a = list(map(int, input().split()))
    a_sum = sum(a)
    ans = 0
    
    for i in range(n):
        ans += a[i] * (a_sum - a[i])
    print(ans // 2 % MOD)
        
        
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))
    
    pre = 1
    for b in a[0:k]:
        pre *= b
    now = pre
        
    for i in range(1, n-k+1):
        now = pre // a[i - 1] * a[k+ i -1]
        if pre < now:
            print('Yes')
        else:
            print('No')
        pre = now
    
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(1, n-k+1):
        if a[i - 1] < a[k+ i -1]:
            print('Yes')
        else:
            print('No')
            
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))
    pre = -1
    for i in range(n-k+1):
        now = 1
        for b in a[i:k+i]:
            now *= b
        if pre == -1:
            pre = now
            continue
        if pre < now:
            print('Yes')
        else:
            print('No')
        pre = now
    
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(1, n-k+1):
        if a[i - 1] < a[k+ i -1]:
            print('Yes')
        else:
            print('No')
            
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())

ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans += gcd(a, b, c)

print(ans)
            

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())

ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans += gcd(a, b, c)

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, m = map(int, input().split())
a = np.array(list(map(int, input().split())) )

a = a / sum(a)
a = (a >= 1/(4*m))
if sum(a)>=m:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np

n, m = map(int, input().split())
a = np.array(list(map(int, input().split())) )

a = a / sum(a)
a = (a >= 1/(4*m))
if sum(a)>=m:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

n = n % k
print(min(abs(n - k)), n)

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

def solve():
    global n, k
    n = n - (k * (n // k))
    pre = n
    while True:
        n = min(n, abs(n-k))
        if n == pre:
            break
        pre = n
    return n

print(solve())
Buggy python submission (verdict: Runtime Error):
s = list(input().split())
if  s[2] == s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
if  s[2] == s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
a = list(map(int, input().split()))
a.append(a[0] + k)
m = []
for i in range(n):
    m.append(m, a[i+1] - a[i])
print(k - max(m))

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

a.append(a[0] + k)
m = 0
s = 0
for i in range(n):
    m = max(m, a[i+1] - a[i])
    s += a[i+1] - a[i]
print(s - m)

Buggy python submission (verdict: Runtime Error):
a.append(a[0] + k)
m = []
for i in range(n):
    m.append(m, a[i+1] - a[i])
print(k - max(m))

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

a.append(a[0] + k)
m = 0
s = 0
for i in range(n):
    m = max(m, a[i+1] - a[i])
    s += a[i+1] - a[i]
print(s - m)
Buggy python submission (verdict: Runtime Error):
def main():
    n, m = map(int, input().split())
    sc = [list(map(int, input().split())) for _ in range(m)]
    
    sc = sorted(sc)
    ans = ''
    pre_s =  -1
    pre_c = sc[0][1]
    for s, c  in sc:
        if pre_s == s and pre_c == c:
            continue
        if (s == 1 and c == 0) or (pre_s == s and pre_c != c):
            print('-1')
            return
        if pre_s == -1 and s != 1:
            ans += str(1)
            pre_s += 2
        i = s - pre_s - 1
        ans += str(0) * i
        ans += str(c)
        pre_s = s
        pre_c = c
    ans += str(0) * (n - pre_s)
        
    print(int(ans))
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n, m = map(int, input().split())
    sc = [list(map(int, input().split())) for _ in range(m)]
    
    ans = [-1]* n
    for s, c in sc:
        s -= 1 
        if ans[s] == -1or ans[s] == c:
            ans[s] = c
        else:
            print(-1)
            return
        
    if ans[0] == -1 and n >1:
        ans[0] = 1
    elif ans[0] == 0:
        if n == 1:
            print(0)
        else:
            print(-1)
        return
    
    print(''.join(list(map(str, ans))).replace('-1', '0'))
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
s= [input() for _ in range(n)]

ans = []
c = collections.Counter(s)
for k, v in c.most_common():
    if v == c.most_common()[0][1]:
        ans.append(k)
ans = sorted(ans)
for i in ans:
    print(i)

Fixed submission:
import collections

n = int(input())
d = {}
for _ in range(n):
    s = input()
    if d.get(s):
        d[s] += 1
    else:
        d[s] = 1
m = 0
ans = []
for k, v in d.items():
    if m < v:
        m = v
        ans = [k]
    elif m == v:
        ans.append(k)
for i in sorted(ans):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
s= [input() for _ in range(n)]

ans = []
c = collections.Counter(s)
for k, v in c.most_common():
    if v == c.most_common()[0][1]:
        ans.append(k)
ans = sorted(ans)
for i in ans:
    print(i)

Fixed submission:
import collections

n = int(input())
d = {}
for _ in range(n):
    s = input()
    if d.get(s):
        d[s] += 1
    else:
        d[s] = 1
m = 0
ans = []
for k, v in d.items():
    if m < v:
        m = v
        ans = [k]
    elif m == v:
        ans.append(k)
for i in sorted(ans):
    print(i)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h =  list(map(int, input().split()))

def solve():
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        print(h[i])
        s -= h[i]
    return s

print(solve())

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())

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

s = sum(h)
h = sorted(h, reverse=True)
for i in range(k):
    s -= h[i]
print(s)

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())

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

s = sum(h)
h = sorted(h, reverse=True)
for i in range(k):
    s -= h[k]
print(s)

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())

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

s = sum(h)
m = 0
for _ in range(k):
    a = 0
    m = 0
    index = 0
    for i, j in enumerate(h):
        if j > m:
            m = j
            index = i
    a += m
    del h[i]
print(s - m)

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())

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

s = sum(h)
for _ in range(k):
    a = 0
    m = 0
    index = 0
    for i, j in enumerate(h):
        if j > m:
            m = j
            index = i
    a += m
    del h[i]
print(s - m)

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        s -= h[i]
    return s

print(solve())
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

ac = [0]*(n+1)
wa = [0]*(n+1)

for _ in range(m):
    a, b = input().split()
    a = int(a)
    if b == 'AC':
        ac[a] = 1
    else: 
        if ac[a] == 0:
            wa[a] = wa[a] + 1

for i in range(n+1):
    wa[a] = wa[a] * ac[a]

print(sum(ac), sum(wa))



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

ac = [0]*(n+1)
wa = [0]*(n+1)

for _ in range(m):
    a, b = input().split()
    a = int(a)
    if b == 'AC':
        ac[a] = 1
    else: 
        if ac[a] == 0:
            wa[a] = wa[a] + 1

for i in range(n+1):
    wa[i] = wa[i] * ac[i]

print(sum(ac), sum(wa))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
    if  a >= 1:
        a -= 1
    elif b >= 1:
        b -=1
print(a, b)

Fixed submission:
a, b, k = map(int, input().split())
b = max(0, b - (k - a) * (k - a > 0))
a = max(0, a - k) 
print(a, b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
s=list(s)
for i in range(len(s)):
    a=ord(s[i])+n
    if a>90:
        a-=26
    s[i]=chr(a)
print(''.join(s))

Fixed submission:
s=input()
a={
'SUN':0,
'MON':1,
'TUE':2,
'WED':3,
'THU':4,
'FRI':5,
'SAT':6
}
print(7-a[s])

Buggy python submission (verdict: Runtime Error):
s=input()
a={
'SUN':0
'MON':1
'TUE':2
'WED':3
'THU':4
'FRI':5
'SAT':6
}
print(7-a[s])


Fixed submission:
s=input()
a={
'SUN':0,
'MON':1,
'TUE':2,
'WED':3,
'THU':4,
'FRI':5,
'SAT':6
}
print(7-a[s])
Buggy python submission (verdict: Runtime Error):
n=input()
s=input()
s2=list(s)
for i in range(len(s2)):
    a=ord(s2[i])+n
    if a>90:
        a-=26
    s2[i]=chr(a)
print(''.join(s2))

Fixed submission:
n=int(input())
s=input()
s=list(s)
for i in range(len(s)):
    a=ord(s[i])+n
    if a>90:
        a-=26
    s[i]=chr(a)
print(''.join(s), end='')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a - 2*b > 0
    print(a - 2*b)
else:
    print(0)

Fixed submission:
a, b = map(int, input().split())
if a - 2*b > 0:
    print(a - 2*b)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    print(sum(list(range(1, n))))
        
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    print((n * (n - 1)) // 2)
        
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = int(input())

if a>=3200:
    print(s)
else:
    print('red')

Fixed submission:
a = int(input())
s = input()

if a>=3200:
    print(s)
else:
    print('red')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    s = []
    ans = 0
    
    for _ in range(n):
        ss = ''.join(sorted(input()))
        s.append(ss)
    
    for i in range(n):
        for j in range(i+1, n):
            if s[i] == s[j]:
                ans += 1
            
    print(ans)
       
    
if __name__ == '__main__':
    main()

Fixed submission:
import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def main():
    n = int(input())
    d = {}
    ans = 0
    
    for _ in range(n):
        ss = ''.join(sorted(input()))
        d[ss] = d.get(ss, 0) + 1
        
    for k, v in d.items():
        if v != 1:
            ans += combinations_count(v, 2)
         
    print(ans)
       
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import collections


def main():
    n = int(input())
    s = [input() for _ in range(n)]
    d = []
    ans = 0
    for ss in s:
        c = collections.Counter(ss)
        d.append(c)
    for i in range(n):
        for j in range(i + 1, n):
            if d[i] == d[j]:
                ans += 1              
    print(ans)  
        
    
if __name__ == '__main__':
    main()

Fixed submission:
import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def main():
    n = int(input())
    d = {}
    ans = 0
    
    for _ in range(n):
        ss = ''.join(sorted(input()))
        d[ss] = d.get(ss, 0) + 1
        
    for k, v in d.items():
        if v != 1:
            ans += combinations_count(v, 2)
         
    print(ans)
       
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    s = [input() for _ in range(n)]
    d = []
    ans = 0
    for ss in s:
        c = collections.Counter(ss)
        d.append(c)
    for i in range(n):
        for j in range(i + 1, n):
            if d[i] == d[j]:
                ans += 1              
    print(ans)  
        
    
if __name__ == '__main__':
    main()

Fixed submission:
import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def main():
    n = int(input())
    d = {}
    ans = 0
    
    for _ in range(n):
        ss = ''.join(sorted(input()))
        d[ss] = d.get(ss, 0) + 1
        
    for k, v in d.items():
        if v != 1:
            ans += combinations_count(v, 2)
         
    print(ans)
       
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
@patch('builtins.input', test.test_input)
def main():
    n = int(input())
    h = list(map(int, input().split()))
    
    pre = h[0]
    for hh in h:
        if hh < pre:
            if hh >= pre - 1:
                pre = hh
            else:
                print('No')
                return
        pre = hh
        
    print('Yes')
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    h = list(map(int, input().split()))
    
    pre = h[0]
    for hh in h:
        if hh < pre-1:
            print('No')
            return
        pre = max(pre, hh)
        
    print('Yes')
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    for _ in range(n):
        tmp = a.pop(0)
        print(max(a))
        a.append(tmp)
   
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    b = sorted(a, reverse=True)
    for i in range(n):
        if b[0] !=  a[i]:
            print(b[0])
        else:
            print(b[1])
   
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

def main():
    n = int(input())
    a = list(map(int, input().split()))
    
    ans = set(divisor(a[0]))
    for i in range(1, n):
        tmp = set(divisor(a[i]))
        ans = ans & tmp
    
    print(max(ans))

    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = min(a)
    next_m = m
    count = 0
    while count != n:
        m = next_m
        count = 0
        pre = a[0]
        for i in range(n):
            if a[i] == pre:
                count += 1
            a[i] %= m
            if a[i] != 0:
                next_m = min(next_m, a[i])
            else:
                a[i] = m
            pre = a[i]
    print(m)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    n, m = map(int, input().split())
    py = [list(map(int, input().split())) for _ in range(m)]
    x = [[0] for _ in range(n+1)]
    for p, y in py:
        bisect.insort_left(x[p], y)
    for p, y in py:
        num = x[p].index(y)
        print('{:0=6}{:0=6}'.format(p, num))
         
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n, m = map(int, input().split())
    py = [list(map(int, input().split())) for _ in range(m)]
    x = sorted(py, key=lambda x:x[1])
    d = {}
    for p, y in x:
        if type(d.get(p)) != dict:
            d[p]  = {}
        d[p][y] = len(d[p]) + 1
    for p, y in py:
        print('{:0=6}{:0=6}'.format(p, d[p][y]))
         
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x = max(x)
y = min(y)

flag = True
for z in range(-100, 100+1):
    if x < z <= y and X < Z <= Y:
        flag = False
        
if flag:
    print('War')
else:
    print('No War')

Fixed submission:
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x = max(x)
y = min(y)

flag = True
for z in range(-100, 100+1):
    if x < z <= y and X < z <= Y:
        flag = False
        
if flag:
    print('War')
else:
    print('No War')
Buggy python submission (verdict: Runtime Error):
r = int(input().split())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Fixed submission:
r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python submission (verdict: Runtime Error):
n = int(input().split())
if n%2==0:
    print(n)
else:
    print(n * 2)

Fixed submission:
n = int(input())
if n%2==0:
    print(n)
else:
    print(n * 2)
Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())
print((100 ** d) * n if n % 100 != 0)
print((100 ** d) * (n+1) if n % 100 == 0)

Fixed submission:
d, n = map(int, input().split())
if n % 100 != 0:
    print((100 ** d) * n)
if n % 100 == 0:
    print((100 ** d) * (n+1))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    s = input()
    
    ans = 10**9
    for i in range(n):
        tmp = 0
        s_center = s[i] 
        for s1 in s[:i]:
            if s1 != 'E':
                tmp += 1
        for s2 in s[i+1:]:
            if s2 != 'W':
                tmp += 1
        ans = min(ans, tmp)
        
    print(ans)
    
        
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    s = input()
    
    a = [0] * (n)
    b = [0] * (n)
    for i in range(1, n):
        if s[i - 1] == 'W':
            a[i] = a[i - 1] + 1
        else:
            a[i] = a[i - 1]
        if s[n- i] == 'E':
            b[n - i - 1] = b[n - i ] + 1
        else:
            b[n- i - 1] = b[n - i ]
    ans = 10**9
    for aa, bb in zip(a, b):
        ans = min(ans, aa++bb)
    print(ans) 
        
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
x = int(input())
s = set()
for i in range(1, x):
    for j in range(2, x):
        if i**j <= x:
            s.add(i**j)
        else:
            break
print(max(s))

Fixed submission:
x = int(input())
s = {1}
for i in range(1, x):
    for j in range(2, x):
        if i**j <= x:
            s.add(i**j)
        else:
            break
print(max(s))
Buggy python submission (verdict: Runtime Error):
s = input()
if ('a' in s) and ('b' in s) and ('c' in s):
    print('Yes')
else;
    print('No')

Fixed submission:
s = input()
if ('a' in s) and ('b' in s) and ('c' in s):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
c =[list(input().split()) for _ in range(3)]
print(c[0][0]+c[1][1]+c[2][2])

Fixed submission:
c =[list(input()) for _ in range(3)]
print(c[0][0]+c[1][1]+c[2][2])
Buggy python submission (verdict: Time Limit Exceeded):
n,Y=map(int, input().split())
a=-1; b=-1; c=-1
for x in range(n+1):
    for y in range(n+1):
        for z in range(n+1):
            if x+y+z==n and 10000*x+5000*y+1000*z==Y:
                a,b,c=[x,y,z]
print(a,b,c)

Fixed submission:
def solve():
    a=-1;b=-1;c=-1
    n,Y=map(int, input().split())
    for x in range(n+1):
        for y in range(n+1):
            if 10000*x+5000*y+1000*(n-x-y)==Y and 0<=n-x-y<=n:
                a,b,c= [x,y,n-x-y]
    return a,b,c

a,b,c=solve()
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
for i in range(1, 100):
    if a*i % b == c:
        print('YES')
        break
else:
    print('NO')

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

for i in range(1, 100):
    if a*i % b == c:
        print('YES')
        break
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, nput().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')

Fixed submission:
a, b, c = map(int, input().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

k,s=map(int, input().split())

p=[]
for i in range(k+1):
    p.append(i)

ans=0
for x in range(k+1):
    for y in range(k+1):
           if p[bisect.bisect_right(p,s-x-y)-1]==s-x-y:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int, input().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=(s-x-y)<=k:
            ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int, input().split())

ans=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if s==x+y+z:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int, input().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=(s-x-y)<=k:
            ans+=1
print(ans)