Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from sys import stdin

n = stdin.readline().rstrip().split()[0]
A = [int(x) for x in stdin.readline().rstrip().split()]

s = str(int((sum(A)**2 - sum([a**2 for a in A])) / 2))

if(int(s) < (10**9 + 7)):
    print(int(s))

x = int(s[-9:]) - 7 * int(s[:-9])
if(x < 0):
    print(x % (10**9 + 7))
else:
    print(x)

Fixed submission:
import sys
 
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))
 
 
def main():
    n = ni()
    A = nl()
    mod = 10 ** 9 + 7
    s = sum(A)
    q = sum([a ** 2 for a in A])
    ans = (((s * s) - q)) // 2
    print(int(ans % mod))
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from sys import stdin

n = stdin.readline().rstrip().split()[0]
A = [int(x) for x in stdin.readline().rstrip().split()]

s = str(int((sum(A)**2 - sum([a**2 for a in A])) / 2))

if(int(s) < (10**9 + 7)):
    print(int(s))

x = int(s[-9:]) - 7 * int(s[:-9])
if(x < 0):
    print(x + 10**9 + 7)
else:
    print(x)

Fixed submission:
import sys
 
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))
 
 
def main():
    n = ni()
    A = nl()
    mod = 10 ** 9 + 7
    s = sum(A)
    q = sum([a ** 2 for a in A])
    ans = (((s * s) - q)) // 2
    print(int(ans % mod))
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
c = 0
N, D = map(float(), input().split())
for i in range(int(N)):
  a,b = map(float(), input().split())
  if a**2 + b**2 <= D:
    c+=1
print(c)

Fixed submission:
c = 0
N, D = list(map(float, input().split()))
for i in range(int(N)):
    a, b = map(float, input().split())
    if a ** 2 + b ** 2 <= D**2:
        c += 1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):

import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

# sys.setrecursionlimit(5000)

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

N = n1()
A = nn()

A.sort(reverse=True)

tbl = [A[0], A[1]]
cft = A[0]

for i in range(2, N):
    c = 0
    d = -1
    for j in range(0, len(tbl)):
        tmp = min(tbl[(j)%len(tbl)], tbl[(j+1)%len(tbl)])
        if tmp > c:
            c = tmp
            d = j

    cft += c
    tbl = tbl[:d+1] + [A[i]] + tbl[d+1:]
    #print(tbl, c, cft)

print(cft)

Fixed submission:

import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

# sys.setrecursionlimit(5000)

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

N = n1()
A = nn()

A.sort(reverse=True)

ans = 0
for i in range(1, N):
    j = i // 2
    ans += A[j]

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

arr = map(float, sys.stdin.readline().strip().split())
print(int(floor(arr[0]*arr[1])))


Fixed submission:
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

arr = list(sys.stdin.readline().strip().split())
arr[0] = int(arr[0])
arr[1] = int(arr[1][0])*100+int(arr[1][2])*10+int(arr[1][3])

print((arr[0]*arr[1])//100)
Buggy python submission (verdict: Runtime Error):

import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

n = int(sys.stdin.readline().strip())
a = array1(n)
b = array1(n)

for i in range(n):
    (a[i], b[i]) = list(map(int, sys.stdin.readline().strip().split()))

a = sorted(a)
b = sorted(b)

if n % 2 == 1:
    print(b[n//2] - a[n//2] + 1)
else:
    print(((b[n/2-1]+b[n/2])/2 - (a[n/2-1]+a[n/2])/2)*2 + 1)



Fixed submission:

import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

n = int(sys.stdin.readline().strip())
a = array1(n)
b = array1(n)

for i in range(n):
    (a[i], b[i]) = list(map(int, sys.stdin.readline().strip().split()))

a = sorted(a)
b = sorted(b)

if n % 2 == 1:
    print(int(b[n//2] - a[n//2] + 1))
else:
    print(int(((b[n//2-1]+b[n//2])/2 - (a[n//2-1]+a[n//2])/2)*2 + 1))
Buggy python submission (verdict: Runtime Error):
import sys, os, re
from pprint import pprint

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(n):
    x, y = list(map(int, sys.stdin.readline().strip().split()))
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

ans = {0: -1}

while len(ans) < n:
    flag = False
    for k, v in ans.items():
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break

print("Yes")
for i in range(1, n):
    print(ans[i]+1)

Fixed submission:

import sys, os, re
from pprint import pprint

a = int(sys.stdin.readline().strip())

if a%10 in [2, 4, 5, 7, 9]:
    print("hon")
elif a%10 in [0, 1,6, 8]:
    print("pon")
elif a%10 in [3]:
    print("bon")
Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heapify, heappop, heappush
from math import ceil
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
A = inpl()
H = [ (-a, 1, a) for a in A]
heapify(H)
for k in range(K):
    _, n, L = heappop(H)
    heappush(H, (-L/(n+1), n+1, L))
ans = int(ceil(-H[0][0]))
print(ans)


Fixed submission:
from heapq import heapify, heappop, heappush
from math import ceil
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
A = inpl()
total = sum(A)
H = []
remnant = K
for a in A:
    n = (K*a)//total
    remnant -= n
    H.append((-a/(n+1), n, a))
heapify(H)
for k in range(remnant):
    L, n, a = heappop(H)
    heappush(H, (-a/(n+2), n+1, a))
ans = int(ceil(-H[0][0]))
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = input()
p0 = X.count('1')
p1, p2 = p0-1, p0+1
mem = {0:0}
def f(n):
    if n in mem:
        return mem[n]
    else:
        p = bin(n).count('1')
        ret = f(n % p) + 1
        mem[n] = ret
        return ret
r1 = r2 = 0
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '1':
        r1 = (r1+k1) % p1
        r2 = (r2+k2) % p2
    k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2

ans = [None]*N
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '0':
        r = (r2 + k2) % p2
    else:
        r = (r1 - k1) % p1
    ans[-i-1] = f(r) + 1
    k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2
for i in range(N):
    print(ans[i])


Fixed submission:
N = int(input())
X = input()
p0 = X.count('1')
p1, p2 = p0-1, p0+1
mem = {0:0}
def f(n):
    if n in mem:
        return mem[n]
    else:
        p = bin(n).count('1')
        ret = f(n % p) + 1
        mem[n] = ret
        return ret
r1 = r2 = 0
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '1':
        if p1 > 0:
            r1 = (r1+k1) % p1
        r2 = (r2+k2) % p2
    if p1 > 0:
        k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2

ans = [None]*N
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '0':
        r = (r2 + k2) % p2
        ans[-i-1] = f(r) + 1
    elif p1 > 0:
        r = (r1 - k1) % p1
        ans[-i-1] = f(r) + 1
    else:
        ans[-i-1] = 0
    if p1 > 0:
        k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2
for i in range(N):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
additions = ['','']
direction = 0
Q = int(input())
for _ in range(Q):
    query = input().split()
    T = int(query[0])
    if T == 1:
        direction ^= 1
    else:
        F = int(query[1])
        C = query[2]
        additions[(F+direction+1) % 2] += C
if direction == 0:
    print(additions[0][::-1], end='')
    print(S, end='')
    print(additions[1])
else:
    print(additions[1][::-1], end='')
    print(S[::-1], end='')
    print(additions[0])

Fixed submission:
S = input()
additions = [[],[]]
direction = 0
Q = int(input())
for _ in range(Q):
    query = input().split()
    T = int(query[0])
    if T == 1:
        direction ^= 1
    else:
        F = int(query[1])
        C = query[2]
        additions[(F+direction+1) % 2].append(C)
if direction == 0:
    print(''.join(additions[0][::-1]), end='')
    print(S, end='')
    print(''.join(additions[1]))
else:
    print(''.join(additions[1][::-1]), end='')
    print(S[::-1], end='')
    print(''.join(additions[0]))
Buggy python submission (verdict: Runtime Error):
N = list(map(int,input()))
K = int(input())
L = len(N)

def comb(n,k):
    if n < 0 or k < 0 or k > n:
        return 0
    ans = 1
    for i in range(k):
        ans *= n-i
    for i in range(k):
        ans //= i+1
    return ans

i = 0
D = [0] * K
M = K
for k in range(K):
    while N[i] == 0 and i < L:
        i += 1
    if i < L:
        D[k] = i
        i += 1
    else:
        M = k
        break

ans = 0
for k in range(M):
    i = D[k]
    ans += comb(L-1-i,K-k)*(9**(K-k))
    ans += (N[i]-1) * comb(L-1-i,K-1-k)*(9**(K-1-k))
if K == M:
    ans += 1

print(ans)


Fixed submission:
N = list(map(int,input()))
K = int(input())
L = len(N)

def comb(n,k):
    if n < 0 or k < 0 or k > n:
        return 0
    ans = 1
    for i in range(k):
        ans *= n-i
    for i in range(k):
        ans //= i+1
    return ans

i = 0
D = [0] * K
M = K
for k in range(K):
    while i < L and N[i] == 0:
        i += 1
    if i < L:
        D[k] = i
        i += 1
    else:
        M = k
        break

ans = 0
for k in range(M):
    i = D[k]
    ans += comb(L-1-i,K-k)*(9**(K-k))
    ans += (N[i]-1) * comb(L-1-i,K-1-k)*(9**(K-1-k))
if K == M:
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = list(map(int,input()))
K = int(input())
L = len(N)

def comb(n,k):
    if n < 0 or k < 0 or k > n:
        return 0
    ans = 1
    for i in range(k):
        ans *= n-i
    for i in range(k):
        ans //= i+1
    return ans

i = 0
D = [0] * K
M = K
for k in range(K):
    while N[i] == 0 and i < L:
        i += 1
    if i < L:
        D[k] = i
        i += 1
    else:
        M = k

ans = 0
for k in range(M):
    i = D[k]
    ans += comb(L-1-i,K-k)*(9**(K-k))
    ans += (N[i]-1) * comb(L-1-i,K-1-k)*(9**(K-1-k))
if K == M:
    ans += 1

print(ans)


Fixed submission:
N = list(map(int,input()))
K = int(input())
L = len(N)

def comb(n,k):
    if n < 0 or k < 0 or k > n:
        return 0
    ans = 1
    for i in range(k):
        ans *= n-i
    for i in range(k):
        ans //= i+1
    return ans

i = 0
D = [0] * K
M = K
for k in range(K):
    while i < L and N[i] == 0:
        i += 1
    if i < L:
        D[k] = i
        i += 1
    else:
        M = k
        break

ans = 0
for k in range(M):
    i = D[k]
    ans += comb(L-1-i,K-k)*(9**(K-k))
    ans += (N[i]-1) * comb(L-1-i,K-1-k)*(9**(K-1-k))
if K == M:
    ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
from heapq import heapify, heappop, heappush
CostMax = 10**9
inpl = lambda: list(map(int,input().split()))
H, N = inpl()
AB = [inpl() for _ in range(N)]
AB.sort(key=lambda x: (x[1], -x[0]))
A = []
B = []
for a, b in AB:
    if len(A)==0 or a > A[-1]:
        A.append(a)
        B.append(b)
L = len(A)
prevcost = defaultdict(lambda: CostMax)

q = [(0,0,0)] # position, last, cost
ans = CostMax
while q:
    pos, last, cost = heappop(q)
    if cost >= prevcost[pos]:
        continue
    else:
        prevcost[pos] = cost
        for n in range(last,L):
            new_pos = pos + A[n]
            new_cost = cost + B[n]
            if new_cost > ans:
                continue
            elif new_pos >= H:
                ans = min(ans, new_cost)
            else:
                heappush(q, (new_pos, n, new_cost))
print(ans)

Fixed submission:
inpl = lambda: list(map(int,input().split()))
H, N = inpl()
A = []
B = []
for _ in range(N):
    a, b = inpl()
    A.append(a)
    B.append(b)

Max = 10**9
dp = [Max] * (H+1)
dp[0] = 0
for h in range(H):
    if dp[h] >= Max:
        continue
    for n in range(N):
        k = h + A[n]
        if k > H:
            k = H
        dp[k] = min(dp[h]+B[n], dp[k])
print(dp[H])
Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heapify, heappop, heappush
import sys
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: tuple(map(int,input().split()))
N, D, A = inpl()
q = []
for _ in range(N):
    x, h = inpl()
    q.append((x, 0, h))
heapify(q)
ans = 0
d = 0
while q:
    x, s, h = heappop(q)
    if s == 0:
        h -= d
        if h <= 0:
            continue
        else:
            k = (h-1)//A + 1
            heappush(q, (x+2*D, 1, k*A))
            d += k*A
            ans += k
    else:
        d -= h
print(ans)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))
Xmax = 10**10
N, D, A = inpl()
XH = [inpl() for _ in range(N)]
XH.sort()
XH.append([Xmax,0])
ans = 0
d = 0
i = j = 0
R = []
while True:
    if j >= len(R) or XH[i][0] <= R[j][0]:
        x, h = XH[i]
        i += 1
        if x >= Xmax:
            break
        h -= d
        if h <= 0:
            continue
        else:
            k = (h-1)//A + 1
            R.append((x+2*D, k*A))
            d += k*A
            ans += k
    else:
        x, h = R[j]
        j += 1
        d -= h
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heapify, heappop, heappush
import sys
sys.setrecursionlimit(10**9)
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))
N, D, A = inpl()
XH = [inpl() for _ in range(N)]
XH.sort()
MONSTER = 1
END = 2
q = [ (XH[i][0], MONSTER, XH[i][1]) for i in range(N)]
heapify(q)
ans = 0
d = 0
while q:
    x, s, h = heappop(q)
    if s == MONSTER:
        h -= d
        if h <= 0:
            continue
        else:
            k = (h-1)//A + 1
            ans += k
            heappush(q, (x+2*D,END,k*A))
            d += k*A
    else: # END
        d -= h
print(ans)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))
Xmax = 10**10
N, D, A = inpl()
XH = [inpl() for _ in range(N)]
XH.sort()
XH.append([Xmax,0])
ans = 0
d = 0
i = j = 0
R = []
while True:
    if j >= len(R) or XH[i][0] <= R[j][0]:
        x, h = XH[i]
        i += 1
        if x >= Xmax:
            break
        h -= d
        if h <= 0:
            continue
        else:
            k = (h-1)//A + 1
            R.append((x+2*D, k*A))
            d += k*A
            ans += k
    else:
        x, h = R[j]
        j += 1
        d -= h
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))

N = int(input())
x = []
y = []
for i in range(N):
    xy = inpl()
    x.append(xy[0])
    y.append(xy[1])
ans2 = 10*12
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a = 2*(x[j]-x[i])
            c = 2*(x[k]-x[j])
            b = 2*(y[j]-y[i])
            d = 2*(y[k]-y[j])
            P = x[j]**2 - x[i]**2 + y[j]**2 - y[i]**2
            Q = x[k]**2 - x[j]**2 + y[k]**2 - y[j]**2

            det = a*d - b*c
            if det == 0:
                continue
            Cx = (d*P - b*Q)/det
            Cy = (a*Q - c*P)/det
            r2 = (Cx-x[i])**2 + (Cy-y[i])**2
            for p in range(N):
                if p in (i,j,k):
                    continue
                if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                    break
            else:
                ans2 = r2

for i in range(N-2):
    for j in range(i+1,N-1):
        Cx = (x[i] + x[j])/2
        Cy = (y[i] + y[j])/2
        for p in range(N):
            if p in (i,j):
                continue
            if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                break
        else:
            ans2 = r2

print(ans2**0.5)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))

N = int(input())
x = []
y = []
for i in range(N):
    xy = inpl()
    x.append(xy[0])
    y.append(xy[1])
ans2 = 10**12
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a = 2*(x[j]-x[i])
            c = 2*(x[k]-x[j])
            b = 2*(y[j]-y[i])
            d = 2*(y[k]-y[j])
            P = x[j]**2 - x[i]**2 + y[j]**2 - y[i]**2
            Q = x[k]**2 - x[j]**2 + y[k]**2 - y[j]**2

            det = a*d - b*c
            if det == 0:
                continue
            Cx = (d*P - b*Q)/det
            Cy = (a*Q - c*P)/det
            r2 = (Cx-x[i])**2 + (Cy-y[i])**2
            for p in range(N):
                if p in (i,j,k):
                    continue
                if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                    break
            else:
                if r2 < ans2:
                    ans2 = r2

for i in range(N-1):
    for j in range(i+1,N):
        Cx = (x[i] + x[j])/2
        Cy = (y[i] + y[j])/2
        r2 = ((x[i]-x[j])**2 + (y[i]-y[j])**2)/4
        for p in range(N):
            if p in (i,j):
                continue
            if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                break
        else:
            if r2 < ans2:
                ans2 = r2

print(ans2**0.5)
Buggy python submission (verdict: Runtime Error):
inpl = lambda: list(map(int,input().split()))
X = int(input())
if X < 100:
    print(0)
elif X <= 105:
    print(1)
dp = [False]*(X+1)
goods = list(range(100,106))
dp[0] = True
for k in goods:
    dp[k] = True

for i in range(200, X+1):
    for k in goods:
        if dp[i-k]:
            dp[i] = True
            break
if dp[X]:
    print(1)
else:
    print(0)

Fixed submission:
inpl = lambda: list(map(int,input().split()))
X = int(input())
if X < 100:
    print(0)
    exit()
elif X <= 105:
    print(1)
    exit()
dp = [False]*(X+1)
goods = list(range(100,106))
dp[0] = True
for k in goods:
    dp[k] = True

for i in range(200, X+1):
    for k in goods:
        if dp[i-k]:
            dp[i] = True
            break
if dp[X]:
    print(1)
else:
    print(0)