Problem:


Score : 100 points

Problem Statement

We have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.

How many grams of sand will the upper bulb contains after t seconds?

Constraints

1≤X≤10^9

1≤t≤10^9

X and t are integers.

Input

The input is given from Standard Input in the following format:

X t

Output

Print the number of sand in the upper bulb after t second.

Sample Input 1

100 17

Sample Output 1

83

17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.

Sample Input 2

48 58

Sample Output 2

0

All 48 grams of sand will be gone, resulting in 0 grams.

Sample Input 3

1000000000 1000000000

Sample Output 3

0



Sample input:
100 17


Sample output:
83

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(len(a)):
    if i < len(a):
        if a[i] == i+1:
            inter=a[i]
            a[i]=a[i+1]
            a[i+1]=inter
            cnt +=1
        continue
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(len(a)):
    if i+1 < N:
        if a[i] == i+1:
            inter=a[i]
            a[i]=a[i+1]
            a[i+1]=inter
            cnt +=1
        continue
print(cnt)

Submission status: Runtime Error

Solution code:
# coding: utf-8

x = int(input())
t = int(input())

1<= x <=10^99
1<= t <=10^99

if (x - t) < 0 : 
    print(0) 
else :
    print(x - t)

Submission status: Runtime Error

Solution code:
N=int(input())
t=int(input())
k=N-t
if (k<=0):
    print(0)
else:
    print(k)

Submission status: Runtime Error

Solution code:
N=int(input())
t=int(input())
k=N-t
if (k<=0):
    print(0)
else:
    print(k)

Submission status: Runtime Error

Solution code:
print max(X-t, 0)

Submission status: Runtime Error

Solution code:
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
for k in range(1, 100002):
    if k in d:
        c += d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)

Submission status: Runtime Error

Solution code:
s=str(input())
x=list(s)
out=""
for i in range(x):
	if (i+1) % 2 ==0:
		out+=x[i]
print(out)

Submission status: Runtime Error

Solution code:
s=str(input())
x=list(s)
out=""
for i in range(x):
	if (i+1) % 2 !=1:
		out+=x[i]
print(out)

Submission status: Runtime Error

Solution code:
s=str(input())
x=list(s)
out=""
for  i in len(x):
 if (i+1) % 2 !=1:
  out+=x[i]
print(out)

Submission status: Runtime Error

Solution code:
s=str(input())
x=list(s)
out=str()
for  i in len(x):
 if (i+1) % 2 !=1:
  out+=x[i]
print(out)

Submission status: Runtime Error

Solution code:
x,t=input().split()
 
print(max(x-t,0))

Submission status: Runtime Error

Solution code:
X,t=input().split

print(max(X-t,0))

Submission status: Runtime Error

Solution code:
X, t=input(int, split())

print(max(X-t),0)

Submission status: Runtime Error

Solution code:
X=input("入力1")
t=input("入力2")
 
y=X-t
 
print(max(y,0))

Submission status: Runtime Error

Solution code:
X=input("入力1")
t=input("入力2")

y=X-t

print(y)

Submission status: Runtime Error

Solution code:
x,t=[int(x) for x in input().split()]
print(max(0,x-t)

Submission status: Runtime Error

Solution code:
    a,b=map(int,input().split())
    if a<b:
        print("0")
    else:
        print(a-b)

Submission status: Runtime Error

Solution code:
# encoding: "utf-8"

from collections import defaultdict

class Stdin:
    @staticmethod
    def read_line(converter=str):
        return [converter(x) for x in input().split()]
    
    @staticmethod
    def read_lines(n, converter=str):
        result = list()
        for _ in range(n):
            result.append(Stdin.read_line(converter))
        return result
    
    @staticmethod
    def convert(data, converter):
        assert(len(data) == len(converter))
        return tuple(map(lambda x, f: f(x), data, converter))

    @staticmethod
    def convert_lines(datas, n, converter):
        return [converter(data, n, converter) for data in datas]


def count_and_del(xs):
    cnt = 0
    fst = xs[-1]
    for x in reversed(xs):
        if x != fst:
            break
        cnt += 1
    del xs[-cnt:]
    return cnt   


def main():
    _ = input()
    xs = Stdin.read_line(converter=int)
    xs.sort(reverse=True)
    ys = defaultdict(int)
    while xs:
        key = xs[-1]
        cnt = count_and_del(xs)
        ys[key] += cnt
        ys[key-1] += cnt
        ys[key+1] += cnt

    print(max(ys.values()))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# encoding: "utf-8"

from collections import defaultdict

class Stdin:
    @staticmethod
    def read_line(converter=str):
        return [converter(x) for x in input().split()]
    
    @staticmethod
    def read_lines(n, converter=str):
        result = list()
        for _ in range(n):
            result.append(Stdin.read_line(converter))
        return result
    
    @staticmethod
    def convert(data, converter):
        assert(len(data) == len(converter))
        return tuple(map(lambda x, f: f(x), data, converter))

    @staticmethod
    def convert_lines(datas, n, converter):
        return [converter(data, n, converter) for data in datas]


def count_and_del(xs):
    cnt = 0
    fst = xs[-1]
    for x in reversed(xs):
        if x != fst:
            break
        cnt += 1
    del xs[-cnt:]
    return cnt   


def main():
    _ = input()
    xs = Stdin.read_line(converter=int)
    xs.sort(reverse=True)
    ys = defaultdict(int)
    while xs:
        key = xs[0]
        cnt = count_and_del(xs)
        ys[key] += cnt
        ys[key-1] += cnt
        ys[key+1] += cnt

    print(max(ys.values()))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# encoding: "utf-8"

from collections import defaultdict

class Stdin:
    @staticmethod
    def read_line(converter=str):
        return [converter(x) for x in input().split()]
    
    @staticmethod
    def read_lines(n, converter=str):
        result = list()
        for _ in range(n):
            result.append(Stdin.read_line(converter))
        return result
    
    @staticmethod
    def convert(data, converter):
        assert(len(data) == len(converter))
        return tuple(map(lambda x, f: f(x), data, converter))

    @staticmethod
    def convert_lines(datas, n, converter):
        return [converter(data, n, converter) for data in datas]


def count_and_del(xs):
    cnt = 0
    fst = xs[-1]
    for x in reversed(xs):
        if x != fst:
            break
        cnt += 1
    del xs[cnt:]
    return cnt   


def main():
    _ = input()
    xs = Stdin.read_line(converter=int)
    xs.sort(reverse=True)
    ys = defaultdict(int)
    while xs:
        key = xs[0]
        cnt = count_and_del(xs)
        ys[key] += cnt
        ys[key-1] += cnt
        ys[key+1] += cnt

    print(max(ys.values()))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
cnt = [0]*100002
for i in a:
    cnt[i-1] += 1
    cnt[i] += 1
    cnt[i+1] += 1
print(max(cnt))

Submission status: Runtime Error

Solution code:
X = input("X")
X = float(X)
t = input("t")
t = float(t)

if X-t<0 :
	ans = 0
else :
	ans = X-t

print(int(ans))

Submission status: Runtime Error

Solution code:
X = input("X")
t = input("t")

if float(X)-float(t)<0 :
	ans = 0

else :
	ans = float(X)-float(t)

print(int(ans))

Submission status: Runtime Error

Solution code:
X = input("X")
t = input("t")

if float(X)-float(t)<0 :
	ans = 0
else :
	ans = float(X)-float(t)

print(int(ans))

Submission status: Runtime Error

Solution code:
X = input("X")
t = input("t")

if int(X)-int(t)<0 :
	ans = 0
else :
	ans = int(X)-int(t)

print(ans)

Submission status: Runtime Error

Solution code:
import sys;
x=int(sys.argv[1])-int(sys.argv[2])
if(x>=0):
    print(x);
else:
    print(0)

Submission status: Runtime Error

Solution code:
X = int(input('input X '))
t = int(input('input t ' ))

print (str(X) + ' ' + str(t))

if (X-t) < 0:
    print (0)
else:
    print (X - t)

Submission status: Runtime Error

Solution code:
s = intput()
ans = ""
for i in range(len(s)):
  if(i % 2 == 0):
    ans = ans + s[i]

print(ans)

Submission status: Runtime Error

Solution code:
print(max(int(input()) - int(input()), 0))

Submission status: Runtime Error

Solution code:
x,t = int(input()),int(input())
y = x - t
print('{0}'.format(y))