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

Fixed submission:
import numpy as np
n,m =map(int, input().split())  #複数数値入力
x=list(map(int, input().split()))  #リスト入力

x.sort()
x_d = list()

if n > m:
    print(0)
else:
    if m == 1:
        print(0)
    else:
#         for i in range(m-1):
#             x_d.append(x[i+1] - x[i])   
        x_d = list(np.diff(x))

#         for i in range(n-1):
            
#             x_d.remove(max(x_d))
            
        x_d.sort(reverse=True)
#         sumd = sum(x_d)  
        sumd = sum(x_d[n-1:])
        print(sumd)

Buggy submission (verdict: Runtime Error):
import pandas as pd

n,m =map(int, input().split())  #複数数値入力
x=list(map(int, input().split()))  #リスト入力

x.sort()



if m == 1:
    print(0)
else:
    x_df = pd.Series(x)
    x_d_df = x_df.diff()
    x_d = x_d_df.values.tolist()
    x_d.pop(0)

    for i in range(n-1):
        x_d.remove(max(x_d))
#         print(x_d)
    
    sumd = sum(x_d)  
    print(sumd)

Buggy submission (verdict: Runtime Error):
n,m =map(int, input().split())  #複数数値入力
x=list(map(int, input().split()))  #リスト入力

x.sort()
x_d = list()

if m == 1:
    print(0)
else:
    for i in range(m-1):
        x_d.append(x[i+1] - x[i])   
    
    for i in range(n-1):
        x_d.remove(max(x_d))
#         print(x_d)
    
    sumd = sum(x_d)  
    print(sumd)

Buggy submission (verdict: Runtime Error):
n,m =map(int, input().split())  #複数数値入力
x=list(map(int, input().split()))  #リスト入力

x.sort()
x_d = list()

if m ==1:
    print(0)
else:
    for i in range(m-1):
        x_d.append(x[i+1] - x[i])

    print(x,x_d)

    for i in range(n-1):
        x_d.remove(max(x_d))
    sumd = sum(x_d)  
    print(sumd)
Problem p03265 (python)

Fixed submission:
import numpy as np

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

x3 = y1-y2+x2
y3 = x2-x1+y2
x4 = y1-y2+x1
y4 = x2-x1+y1

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
import matplotlib as mpl

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

x3 = y1-y2+x2
y3 = x2-x1+y2
x4 = y1-y2+x1
y4 = x2-x1+y1

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))
Problem p02659 (python)

Fixed submission:
from decimal import *
a,b = map(Decimal,input().split())
exp = Decimal(a*b)
print(int(exp))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
A = int(a)
B = int(b*100)
ans = A*B//100
print(ans)
Problem p02860 (python)

Fixed submission:
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n = INT()
s = input()

if n%2 == 1:
    print('No')
else:
    flag = True
    for i in range(n//2):
        if s[i] != s[n//2 + i]:
            flag = False
    if flag:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n = INT()
s = input()

if n %2 == 0:
    print('No')
else:
    flag = True
    for i in range(n):
        if s[i] != s[n//2 + i]:
            flag = False
    if flag:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n = INT()
s = input()

if n %2 == 0:
    print('No')
else:
    flag = True
    for i in range(n):
        if s[i] != s[n//2 + i]:
            flag = False
    if flag:
        print('Yes')
    else:
        print('No')
Problem p02879 (python)

Fixed submission:
import sys
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

a, b= MAP()

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = int(input())
if a >= 10 or b >= 10:
  print(-1)
else:
  print(a*b)
Problem p02916 (python)

Fixed submission:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
n = INT()
A = LIST()
B = LIST()
C = LIST()
ans = 0
for i in range(n-1):
  if A[i]+1 == A[i+1]:
    ans += C[A[i]-1]
print(ans + sum(B))

Buggy submission (verdict: Runtime Error):
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
n = INT()
A = LIST()
B = LIST()
C = LIST()
ans = 0
for i in range(n):
  if A[i]+1 == A[i+1]:
    ans += C[i]
print(ans + sum(B))
Problem p02959 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

def f(n):
    nn = min(a[n], b[n])
    nnn = min(a[n+1], b[n] - nn)
    a[n+1] -= nnn
    return nn + nnn

for i in range(n):
    ans += f(i)

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

def f(i,j):
    if i == 0 and j == 0:
        return min(a[0], b[0])
    elif i == j:
        return min(a[i] - f(i-1,i), b[i])
    else:
        return min(a[i+1], b[i] - f(i,i))
        
for i in range(n):
    ans += f(i, i)
    ans += f(i, i+1)

print(ans)
Problem p02970 (python)

Fixed submission:
import numpy as np

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

print(int(np.ceil(n/(2*d+1))))

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

n,d= int(input())

print(int(np.ceil(n/(2*d+1))))
Problem p02781 (python)

Fixed submission:
N = input()
L = len(N)
K = int(input())
if L < K:
    print(0)
else:

    def main(d, k):
        if d == L:
            return 0
        if N[d] == "0":
            return main(d + 1, k)
        if (L - d) < k:
            return 0
        if k == 1:
            return ((L - d) - 1) * 9 + int(N[d])
        elif k == 2:
            return (
                ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81
                + ((L - d) - 1) * 9 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )
        elif k == 3:
            return (
                ((((L - d) - 1) * ((L - d) - 2) * ((L - d) - 3)) // 6) * (9 ** 3)
                + ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )

    print(main(0, K))

Buggy submission (verdict: Runtime Error):
N = input()
L = len(N)
K = int(input())
if L < K:
    print(0)
else:

    def main(d, k):
        if N[d] == "0":
            return main(d + 1, k)
        if (L - d) < k:
            return 0
        if k == 1:
            return ((L - d) - 1) * 9 + int(N[d])
        elif k == 2:
            return (
                ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81
                + ((L - d) - 1) * 9 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )
        elif k == 3:
            return (
                ((((L - d) - 1) * ((L - d) - 2) * ((L - d) - 3)) // 6) * (9 ** 3)
                + ((((L - d) - 1) * ((L - d) - 2)) // 2) * 81 * (int(N[d]) - 1)
                + main(d + 1, k - 1)
            )

    print(main(0, K))
Problem p02862 (python)

Fixed submission:
import math
import sys

sys.setrecursionlimit(10 ** 7)


x, y = map(int, input().split())
mod = 10 ** 9 + 7

fac = [1]
caf = [1]


def pow(n, p):
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod


n = (x + y) // 3 + 10

for i in range(1, n):
    fac.append((fac[i - 1] * i) % mod)
    caf.append(pow(fac[i], mod - 2))


def ncr(n, r):
    if n < r or r < 0:
        return 0
    return (fac[n] * caf[r] * caf[n - r]) % mod


if (x + y) % 3 != 0:
    print(0)
else:
    n = (x + y) // 3
    r = (2 * x - y) // 3
    print(ncr(n, r))

Buggy submission (verdict: Runtime Error):
import math
import sys

sys.setrecursionlimit(10 ** 7)


x, y = map(int, input().split())
mod = 10 ** 9 + 7

fac = [1]
caf = [1]


def pow(n, p):
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod


n = (x + y) // 3 + 10

for i in range(1, n):
    fac.append((fac[i - 1] * i) % mod)
    caf.append(pow(fac[i], mod - 2))


def ncr(n, r):
    if n < r:
        return 0
    return (fac[n] * caf[r] * caf[n - r]) % mod


if (x + y) % 3 != 0:
    print(0)
else:
    n = (x + y) // 3
    r = (2 * x - y) // 3
    print(ncr(n, r))

Buggy submission (verdict: Runtime Error):
import math

x, y = map(int, input().split())
mod = 10 ** 9 + 7

fac = [1]
caf = [1]


def pow(n, p):
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod


n = (x + y) // 3 + 1

for i in range(1, n):
    fac.append((fac[i - 1] * i) % mod)
    caf.append(pow(fac[i], mod - 2))


def ncr(n, r):
    if n < r:
        return 0
    return (fac[n] * caf[r] * caf[n - r]) % mod


if (x + y) % 3 != 0:
    print(0)
else:
    n = (x + y) // 3
    r = (2 * x - y) // 3
    print(ncr(n, r))
Problem p02891 (python)

Fixed submission:
s = input()
k = int(input())
if len(s) == 1:
    print(k // 2)
else:

    def counts(s):
        count = 0
        for i in range(len(s) - 1):

            if s[i] == s[i + 1]:
                count += 1
                s = s[: i + 1] + "." + s[i + 2 :]
        return count

    res1 = counts(s)
    res2 = counts(s * 2)
    res3 = counts(s * 3)
    if res3 - res2 == res2 - res1:
        print(res1 + (res2 - res1) * (k - 1))
    else:
        if k % 2 == 1:
            print(res2 * (k // 2) + res1)
        else:
            print(res2 * (k // 2))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(n):
    s.append(input())
check = []
testc = 1000
for i in range(n):
    test = 0
    for c in s[i]:
        test += int(c)
    if test == testc:
        check.append(i)
    elif test < testc:
        check.clear()
        testc = test
        check.append(i)

res = -1
for i in check:
    tres = 1
    flag = [-2 for _ in range(n)]

    flag[i] = 1
    que = [i]
    while que:
        target = que.pop()
        for j in range(n):
            if s[target][j] == "1":
                if flag[j] == -2:
                    flag[j] = flag[target] + 1
                    que.append(j)
                elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:
                    tres = -1
                    break
        if tres == -1:
            break
    if tres == -1:
        continue
    else:
        res = max(res, max(flag))

print(res)
Problem p02892 (python)

Fixed submission:
import collections

n = int(input())
s = []
for _ in range(n):
    ch = input()
    s.append([int(c) for c in ch])


def graph(i, n, s):
    flag = [-2 for _ in range(n)]
    flag[i] = 1
    que = collections.deque([i])
    while que:
        target = que.popleft()
        for j in range(n):
            if s[target][j] == 1:
                if flag[j] == -2:
                    flag[j] = flag[target] + 1
                    que.append(j)
                elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:
                    return [-1, -1]
    mf = max(flag)
    return [flag.index(mf), mf]


r1 = graph(0, n, s)
if r1[0] == -1:
    print(-1)
else:
    res = r1[1]
    for i in range(1, n):
        r = graph(i, n, s)
        res = max(res, r[1])
    print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(n):
    s.append(input())
check = []
testc = 1000
for i in range(n):
    test = 0
    for c in s[i]:
        test += int(c)
    if test == testc:
        check.append(i)
    elif test < testc:
        check.clear()
        testc = test
        check.append(i)

res = -1
if testc > 1:
    check = check[0]

for i in check:
    tres = 1
    flag = [-2 for i in range(n)]

    flag[i] = 1
    que = [i]
    while que:
        target = que.pop()
        for j in range(n):
            if s[target][j] == "1":
                if flag[j] == -2:
                    flag[j] = flag[target] + 1
                    que.append(j)
                elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:
                    tres = -1
                    break
        if tres == -1:
            break

    if tres == -1:
        continue
    else:
        res = max(res, max(flag))

print(res)
Problem p02912 (python)

Fixed submission:
import heapq

n,m  = map(int,input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for _ in range(m):
    tmax = heapq.heappop(a)
    tmax = -(-tmax //2)
    heapq.heappush(a,tmax)

print(-1*sum(a))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
a.sort(reverse=True)
b = [a[0], a[1]]


def hikaku(i, tempb):
    b[i - 1] = b[i]
    b[i] = tempb
    if len(b) == i + 1:
        b.append(a[i + 1])
    if b[i] < b[i + 1]:
        hikaku(i + 1, tempb)


while m > 0:
    b[0] = b[0] // 2
    if b[0] < b[1]:
        hikaku(1, b[0])
    if b[0] < 1:
        break
    m -= 1


if b[0] < 1:
    print(0)
else:
    for i in range(len(b), len(a)):
        b.append(a[i])
    print(sum(b))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
a.sort(reverse=True)


def waru(i, tempb):
    if a[i] >= 1:
        a[i - 1] = a[i]
        a[i] = tempb

        if a[i] < a[i + 1]:
            waru(i + 1, tempb)


while m > 0:
    a[0] = a[0] // 2
    if a[0] < a[1]:
        waru(1, a[0])
    if a[0] < 1:
        break
    m -= 1

if a[0] < 1:
    print(0)
else:
    print(sum(a))

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
a.sort(reverse=True)


def waru(i, tempb):
    if a[i] >= 1:
        a[i - 1] = a[i]
        a[i] = tempb

        if a[i] < a[i + 1]:
            waru(i + 1, tempb)


while m > 0:
    a[0] = a[0] // 2
    if a[0] < a[1]:
        waru(1, a[0])
    if a[0] < 1:
        break
    m -= 1

if a[0] < 1:
    print(0)
else:
    print(sum(a))

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
a.sort(reverse=True)


def waru(i, tempb):
    if a[i] >= 1:
        a[i - 1] = a[i]
        a[i] = tempb

        if a[i] < a[i + 1]:
            waru(i + 1, tempb)


while m > 0:
    a[0] /= 2
    if a[0] < a[1]:
        waru(1, a[0])
    if a[0] < 1:
        break
    m -= 1

if a[0] < 1:
    print(0)
else:
    b = []
    for i in a:
        b.append(math.floor(i))

    print(sum(b))

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
a.sort(reverse=True)


def waru(i, tempb):
    a[i - 1] = a[i]
    a[i] = tempb

    if a[i] < a[i + 1]:
        waru(i + 1, tempb)


while m > 0:
    a[0] /= 2
    if a[0] < a[1]:
        waru(1, a[0])
    m -= 1

b = []
for i in a:
    b.append(math.floor(i))

print(sum(b))
Problem p02948 (python)

Fixed submission:
import heapq

n,m = map(int,input().split())
lb = [[] for _ in range(10**5+5)]
for _ in range(n):
    a,b = map(int,input().split())
    lb[a].append(b)
res = 0
q = []
heapq.heapify(q)
for i in range(1,m+1):
    for b in lb[i]:
        heapq.heappush(q,b * (-1))
    if q:
        res += heapq.heappop(q) * (-1)

print(res)

Buggy submission (verdict: Runtime Error):
import heapq

n,m = map(int,input().split())
lb = [[] for _ in range(10**5)]
for _ in range(n):
    a,b = map(int,input().split())
    lb[a].append(b)
res = 0
q = []
heapq.heapify(q)
for i in range(1,m+1):
    for b in lb[i]:
        heapq.heappush(q,b * (-1))
    if q:
        res += heapq.heappop(q) * (-1)

print(res)
Problem p03015 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)

l=input()
n = len(l)
mod = 10**9+7

p3 = [1]
for _ in range(len(l)+5):
    p3.append((p3[-1]*3)%mod)

def dfs(k,f):
    if k == n:
        return 1
    if not f:
        return p3[n-k]
    if l[k] == "1":
        return (dfs(k+1,False)+dfs(k+1,True)*2)%mod
    else:
        return dfs(k+1,True)%mod

print(dfs(0,True))

Buggy submission (verdict: Runtime Error):
l=input()
n = len(l)
mod = 10**9+7

p3 = [1]
for _ in range(len(l)+5):
    p3.append((p3[-1]*3)%mod)

def dfs(k,f):
    if k == n:
        return 1
    if not f:
        return p3[n-k]
    if l[k] == "1":
        return (dfs(k+1,False)+dfs(k+1,True)*2)%mod
    else:
        return dfs(k+1,True)%mod

print(dfs(0,True))
Problem p03426 (python)

Fixed submission:
h,w,d=map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]

dx = [0 for _ in range(h*w+5)]
dy = [0 for _ in range(h*w+5)]

for i in range(h):
    for j in range(w):
        dx[a[i][j]] = i
        dy[a[i][j]] = j

dfromd = [0 for _ in range(h*w+1)]

for i in range(d+1,h*w+1):
        dfromd[i] = dfromd[i-d]+abs(dx[i-d]-dx[i])+abs(dy[i-d]-dy[i])

q = int(input())
for _ in range(q):
    l,r=map(int,input().split())
    print(dfromd[r]-dfromd[l])

Buggy submission (verdict: Runtime Error):
h,w,d=map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]

dx = [0 for _ in range(h*w+5)]
dy = [0 for _ in range(h*w+5)]

for i in range(h):
    for j in range(w):
        dx[a[i][j]] = i
        dy[a[i][j]] = j

dfromd = [[0 for _ in range((h*w+5)//d)] for _ in range(h*w+5)]

for i in range(h*w-d+3):
    for j in range(1,(h*w+5)//d):
        if i+d*j <= h*w+3:
            dfromd[i][j] = dfromd[i][j-1] + abs(dx[i+d*j]-dx[i+d*(j-1)])+abs(dy[i+d*j]-dy[i+d*(j-1)])

q = int(input())
for _ in range(q):
    l,r=map(int,input().split())
    print(dfromd[l][(r-l)//d])
Problem p04021 (python)

Fixed submission:
import bisect

def main():
    n = int(input())
    l = [[i,int(input())] for i in range(n)]
    l.sort(key=lambda x:x[1])
    res =0
    for i in range(n):
        if i % 2 != l[i][0] % 2:
            res += 1
    print(res // 2)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a=[]
    b=[]
    if n == 1:
        a=int(input())
        print(0)
    else:
        for i in range(n//2):
            a.append(int(input()))
            b.append(int(input()))

        if n % 2 == 1:
            a.append(int(input()))

        a.sort()
        b.sort()
        ta=a[0]
        tb=b[0]
        if ta < tb:
            res = 0
        else:
            tb = ta
            res = 1

        for i in range(1,n//2+1):
            if a[i] < tb:
                ta = tb
                res += 1
            else:
                ta = a[i]
            if b[i] < ta:
                tb =ta
                res += 1
            else:
                tb = b[i]
        if n % 2 == 1:
            if a[-1] < tb:
                res += 1

        print(res)
main()
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()

if len(S) > K:

    for i in range(0,K):

        print(S[i], end="")

    print("...")

else:

    print(S)

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

############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()

def invr():
    return(map(int,input().split()))

def solve(s,k):
    len1 = len(s)
    if len1 > k:
        corte = ''
        for i in range(k):
            corte += s[i]
        corte += '...'
        return corte
	else :
      return s
def main():
    k = inp()
    print(solve(input(),k))


main()
Problem p03208 (python)

Fixed submission:
N, K = map(int,input().split())
li = []

for i in range(N):
        li.append(int(input()))

li.sort()

co = K - 1
hmin = li[co] - li[0]
for i in range(N-K+1):
        if hmin > li[i+co] - li[i]:
                hmin = li[i+co] - li[i]
                if hmin == 0:
                        break
print(hmin)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
li = []

for i in range(N):
        li.append(int(input()))

li.sort()

co = K - 1
hmin = 1000000
for i in range(N-K+2):
        if hmin > li[i+co] - li[i]:
                hmin = li[i+co] - li[i]
                if hmin == 0:
                        break
print(hmin)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
li = []

for i in range(N):
        li.append(int(input()))

li.sort()

co = K - 1
hmin = 1000000
for i in range(N):
        if hmin > li[i+co] - li[i]:
                hmin = li[i+co] - li[i]
                if hmin == 0:
                        break
print(hmin)
Problem p03072 (python)

Fixed submission:
N = int(input())
s = input().split()
count = 1
for i in range(N):
  s[i] = int(s[i])
for i in range(1,N):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = input().split()
count = 1
for i in range(N):
  s[i] = int(s[i])
for i in range(1,N+1):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N = input()
s = input().split()
count = 1
for i in range(N):
  s[i] = int(s[i])
for i in range(1,N+1):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N = input()
s = input().split()
count = 1
for i in range(1,N+1):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N = input()
s = input().split()
count = 0
for i in range(N):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (e-a)>k:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input().split())
b = int(input().split())
c = int(input().split())
d = int(input().split())
e = int(input().split())
k = int(input().split())
if (e-a)>k:
    print(":(")
else:
    print("Yay!")
Problem p03286 (python)

Fixed submission:
N = int(input())
base = ""
d = 0
if N == 0:
    print(0)
else:
    while N != 0:
        if N%2 == 0:
            base += "0"
            N = N//2
        else:
            base += "1"
            if d%2 == 0:
                N = (N-1)//2
            else:
                N = (N+1)//2
        d += 1
    print(int(base[::-1]))

Buggy submission (verdict: Runtime Error):
N = int(input())
base = ""
d = 0
while N != 0:
    if N%2 == 0:
        base += "0"
        N = N//2
    else:
        base += "1"
        if d%2 == 0:
            N = (N-1)//2
        else:
            N = (N+1)//2
    d += 1
print(int(base[::-1]))
Problem p02951 (python)

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

if c - (a - b) >= 0:
    print(c - (a - b))
else:
    print(0)

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

if c - (a - b) >= 0:
    print(c - (a - b))
else:
    print(0)