Problem:


Score : 100 points

Problem Statement

You are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)

Write a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.

Constraints

S is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.

Input

Input is given from Standard Input in the following format:

S

Output

Print Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.

Sample Input 1

2019/04/30

Sample Output 1

Heisei

Sample Input 2

2019/11/01

Sample Output 2

TBD



Sample input:
2019/04/30


Sample output:
Heisei

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
 
 
def solve(n: int, m: int, Q: int, s: "List[int]", t: "List[int]", x: "List[int]"):
 
    def check_pos(target, a, x):
        ret = {}
        a_x = a + x
        a_x.sort()
        idx = 0
        while idx < len(a_x) and a_x[idx] < target[0]:
            dis = target[0] - a_x[idx]
            ret[a_x[idx]] = [dis, [target[0], dis]] # [pos, dis]
            idx += 1
        for i in range(len(target) - 1):
            while idx < len(a_x) and target[i] <= a_x[idx] <= target[i + 1]:
                pos = a_x[idx]
                l = a_x[idx] - target[i]
                r = target[i + 1] - a_x[idx]
                ret[pos] = [
                    min(l, r),
                    [target[i],     l],
                    [target[i + 1], r]
                ]
                idx += 1
        while idx < len(a_x):
            dis = a_x[idx] - target[-1]
            ret[a_x[idx]] = [dis, [target[-1], dis]] # [pos, dis]
            idx += 1
        return ret
 
    nearest_s = check_pos(s, t, x)
    nearest_t = check_pos(t, s, x)
    print('hoge')
    return
 
    for q in x:
        ret = min(
                min([(pos_dis[1] + nearest_t[pos_dis[0]][0]) for pos_dis in nearest_s[q][1:]]),
                min([(pos_dis[1] + nearest_s[pos_dis[0]][0]) for pos_dis in nearest_t[q][1:]]))
        print(ret)
    return
 
 
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    s = [ int(next(tokens)) for _ in range(A) ]  # type: "List[int]"
    t = [ int(next(tokens)) for _ in range(B) ]  # type: "List[int]"
    x = [ int(next(tokens)) for _ in range(Q) ]  # type: "List[int]"
    solve(A, B, Q, s, t, x)
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
input = str(input())
input.split('/')

if input[1] != '10':
  input[1].replace('0', '')
input = int(input)

if (input[0] > 2019) or ( (input[0] == 2019) and (input[1] > 4) ):
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
date=input()
yr=slice(int[0:4])
mn=slice(int[5:7])
dy=slice(int[8:10])
if yr <2019:
  print("Heisei")
elif yr >2019:
  print("TBD")
else:
  if mn<4:
    print("Heisei")
  elif mn>4:
    print("TBD")
  else:
    print("Heisei")

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split('/')))
flag = 1
if s[0] > 2019:
    flag = 0
elif s[0] == 2019:
    if s[1] > 4:
        flag = 0

ans_list = ['TBD', 'Heisei']
print(ans[flag])

Submission status: Runtime Error

Solution code:
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if(s.compareTo("2019/04/30") <= 0){
            System.out.println("Heisei");
        } else {
            System.out.println("TBD");
        }
    }
}

Submission status: Runtime Error

Solution code:
y,m,d = list(map(int, input().split("/")))

if y < 2019 or (y =2019 and m <=4):
  print(Heisei)
else:
  print(TBD)

Submission status: Runtime Error

Solution code:
Y, M, D = map(int, input().split(/))
boo = False
if Y < 2019:
  boo = True
else:
  if Y == 2019 and M <= 4:
    boo = True
if boo:
  print("Heisei")
else:
  print("TBD")

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split('/')))
if s[0] = 2018 and s[1] > 4:
  print("TBD")
elif s[0] >2018:
  print("TBD")
else : print("Heisei")

Submission status: Runtime Error

Solution code:
S=input()
s=S[6:8]
if '0' in s:
  if s == '10':
     s = s
  else:
     s = s.strip('0')
n = int(s)
if n<=4:
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
S=input()
s=S[6:8]
if '0' in s:
  if s == '10':
     s = s
  else:
    s = s.replace('0','')
n = int(s)
if n<=4:
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
#coding:utf-8
import sys

BAMB_NUM = 0
BAMB_A = 0
BAMB_B = 0
BAMB_C = 0
BAMB_LIST = []

def calcMP(idx, lenA, lenB, lenC):
    """
    calculate MP.
    """
    # when classified all bamboos
    if (idx == BAMB_NUM):
        return abs(lenA - BAMB_A) + abs(lenB - BAMB_B) + abs(lenC - BAMB_C) - 30 if min(lenA, lenB, lenC) > 0 else sys.maxsize
    
    # don't use idx-th bamboo
    mp1 = calcMP(idx + 1, lenA, lenB, lenC)
    # use idx-th bamboo
    mp2 = calcMP(idx + 1, lenA + BAMB_LIST[idx], lenB, lenC) + 10
    mp3 = calcMP(idx + 1, lenA, lenB + BAMB_LIST[idx], lenC) + 10
    mp4 = calcMP(idx + 1, lenA, lenB, lenC + BAMB_LIST[idx]) + 10

    return min(mp1, mp2, mp3, mp4)

if __name__ == "__main__":
    """
    http://drken1215.hatenablog.com/entry/2019/02/24/224100
    """
    # requested bamboo lengths
    BAMB_NUM, BAMB_A, BAMB_B, BAMB_C = map(lambda x: int(x), input().split())
    # available bamboo lengths
    for bamb in range(BAMB_NUM):
        BAMB_LIST.append(int(input()))

    mp = calcMP(0, 0, 0, 0)
    print(mp)

Submission status: Runtime Error

Solution code:
S=input()
u=S[7:8]
U=int(u)
if U<=4:
    print('Heisei')
else:
    print('TBD')

Submission status: Runtime Error

Solution code:
S=input()
u=S[6:8]
U=int(u)
if U<=4:
    print('Heisei')
else:
    print('TBD')

Submission status: Runtime Error

Solution code:
S=input()
u=s[6:8]
U=int(u)
if U<=4:
    print('Heisei')
else:
    print('TBD')

Submission status: Runtime Error

Solution code:
#coding:utf-8
import sys

BAMB_NUM = 0
BAMB_A = 0
BAMB_B = 0
BAMB_C = 0
BAMB_LIST = []

def calcMP(idx, lenA, lenB, lenC):
    # when classified all bamboos
    if (idx == BAMB_NUM):
        # exists a zero length bamboo
        if (lenA <= 0 or lenB <= 0 or lenC <= 0):
            return sys.maxsize
        return abs(lenA - BAMB_A) + abs(lenB - BAMB_B) + abs(lenc - BAMB_C)
    
    # don't use idx-th bamboo
    mp = calcMP(idx+1, lenA, lenB, lenC)

    # use idx-th bamboo
    mp = min(mp, calcMP(idx + 1, lenA + BAMB_LIST[idx], lenB, lenC) + (BAMB_A > 0 ? 10 : 0))
    mp = min(mp, calcMP(idx + 1, lenA, lenB + BAMB_LIST[idx], lenC) + (BAMB_B > 0 ? 10 : 0))
    mp = min(mp, calcMP(idx + 1, lenA, lenB, lenC + BAMB_LIST[idx]) + (BAMB_C > 0 ? 10 : 0))

    return mp

if __name__ == "__main__":
    """
    http://drken1215.hatenablog.com/entry/2019/02/24/224100
    """
    # requested bamboo lengths
    bamb_num, bambA, bambB, bambC = map(lambda x: int(x), input().split())
    # available bamboo lengths
    bamb_list = []
    for bamb in range(bamb_num):
        bamb_list.append(int(input()))

    mp = calcMP(0, 0, 0, 0)
    print(mp)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
from bisect import bisect_right


def solve(A: int, B: int, Q: int, s: "List[int]", t: "List[int]", x: "List[int]"):
    b, d = bisect_right(s, x), bisect_right(t, x)
    INF = 10e11
    ret = INF

    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            ret = min(ret, d1, d2)
    print(ret)


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    INF = 10e11
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    s = [-INF] + [int(next(tokens)) for _ in range(A)] + [INF]  # type: "List[int]"
    t = [-INF] + [int(next(tokens)) for _ in range(B)] + [INF]  # type: "List[int]"

    for x in range(Q):
        x = int(input())
        solve(A, B, Q, s, t, x)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a = input()
date = list(a)
year = int(date[0])*1000 + int(date[1])*100 + int(date[2])*10 + int(date[3])
mon = int(date[4])*10 + int(date[5])
day = int(date[6])*10 + int(date[7])
if year < 2019 and mon < 5 :
  print("Heise")
else :
  print("TBD")

Submission status: Runtime Error

Solution code:
s = input()
year = int(s[0:4])
month = int(s[5:7])

if yaer >= 2019 and month >= 5:
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
date = map(int,input().split('/'))
print('TBD' if data[0]>=2019 and data[1]*30+data[2]>=150 else 'Heisei')

Submission status: Runtime Error

Solution code:
import pandas as pd
date = pd.to_datetime(input().rstrip())
if date > pd.to_datetime("2019/4/30"):
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
import pandas as pd
date = pd.to_datetime(input().rstrip())
if date > pd.to_datetime("2019/4/30"):
  print("TBD)
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
 s=input()
 if s<='2019/4/30':
 	print("Heisei")
 else:
 	print("TBD")

Submission status: Runtime Error

Solution code:
y,m,d=map(int,input().split("/"))
if y<=2018 :
    print(Heisei)
elif y==2019 :
    if m<=4 :
        print(Heisei)
    else:
        print(TBD)
else :
    print(TBD)

Submission status: Runtime Error

Solution code:
y,m,d=map(int,input().split(/))
if y<=2018 :
    print(Heisei)
else:
    if m<=4 :
        print(Heisei)
    else:
        print(TBD)

Submission status: Runtime Error

Solution code:
import datetime

a  = (datetime.datetime.strptime('2019/04/30', '%Y/%m/%d') - datetime.datetime.strptime(input(), '%Y/%m/%d')).days

print('Heisei' a >= 0 else 'TBD')

Submission status: Runtime Error

Solution code:
import datetime

a  = (datetime.datetime.strptime('2019/04/30', '%Y/%m/%d') - datetime.datetime.strptime(input(), '%Y/%m/%d')).days

print('Heisei'a >= 0 else 'TBD')

Submission status: Runtime Error

Solution code:
S = input().split("/")

if S[0]>= 2020:
  print("TBD")
elif S[0] == 2019:
  if S[1] >5:
    print("TBD")
  else:
    print("Heisei")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
import datetime
a = input().split("/")

date1 = datetime.datetime(a[0], a[1], a[2])
date2 = datetime.datetime(2019, 4, 30)

if date1 > date2:
    print("TBD")
else:
    print("Heisei")

Submission status: Runtime Error

Solution code:
lis = list(input().split("/"))
if lis[1] <= 4:
  print("Heisei")
else:
  print("TBD")

Submission status: Runtime Error

Solution code:
y,m,d=list(map(int,input().split("/")))
if y>2019:
  print("TBD")
elif y<2019:
  print("Heisei")
elif m>4:
  print("TBD")
elif m<4:
  print("Heisei")
elif d=30:
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
y, m, d = [int(x) for x in S.split('/')]
if y>=2020:
    answer = "Heisei"
elif:
    y = 2019 and m >= 5:
    answer = "Heisei"
else:
    answer = "TBD"

Submission status: Runtime Error

Solution code:
import bisect
inf = 10**18
A,B,Q = map(int,input().split(' '))
ss = [-inf] + sorted([int(input()) for i in range(1,A+1)]) + [inf]
ts = [-inf] + sorted([int(input()) for i in range(A+1,A+B+1)]) + [inf]

def f0(A,x):
  i = bisect.bisect_left(A, x)
  return i, i-1
def f1(A,B,x):
  a = f0(A,x)
  bs = [f0(B,A[i]) for i in a]
  return min([abs(A[i]-x) + abs(A[i]-B[j]) 
              for ix, i in enumerate(a) 
              for j in bs[ix]]) 

for i in range(A+B+1,A+B+Q+1):
  x = int(input())
  print(min(f1(ss,ts,x),f1(ts,ss,x)))

Submission status: Runtime Error

Solution code:
from dateutil.parser import parse
timestamp1 = "2019/04/30"
timestamp2 = input()
d1 = parse(timestamp1)
d2 = parse(timestamp2)
if d2 > d1 :
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
N = int(input())
rateBtcYen =  380000.0 
totalYen = 0
for i in range(0, N):
    amountString, currency = input().split()
    amount = float(amountString)
    if currency == "BTC":
        totalYen += amount*rateBtcYen
    else:
        totalYen += amount
print(totalYen)

Submission status: Runtime Error

Solution code:
N = int(input())
total = 0.0
rate = 380000

for i in range(N):
  a,t = input().split()
  if(t=="BTC"):
    total += float(a) * rate
  else:
    total += float(a)
print(total)

Submission status: Runtime Error

Solution code:
N = input()
total = 0

for i in range(len(N)):
    if (N[i][1]=="BTC"):
        total += float(N[i][0])*380000
    else:
        total += float(N[i][0])
print(total)

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())

x = b // a

if x <= c:
	print(x)

else:
	print(c)

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())

x = b // a

if x <= c:
	print(x)

else:
	print(c)

Submission status: Runtime Error

Solution code:
import sys

for S in sys.stdin
  if S <= '20190430':
    print('Heisei')
  else:
    print('TBD')

Submission status: Runtime Error

Solution code:
import sys

S = sys.argv
if S <= '20190430':
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')

Submission status: Runtime Error

Solution code:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or m==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
    yy,mm,dd =map(int,input().split('/'))
    x = 0
    if(yy<=2019):
      if(mm<=4):
        if(dd<=30):
         x = 1
     
    if(x == 1):
      print('Heisei')
    else:
      print('TBD')

Submission status: Runtime Error

Solution code:
    yy,dd,mm =map(int,input().split('/'))
    x = 0
    if(yy<=2019):
      if(mm<=4):
        if(dd<=30):
         x = 1
     
    if(x == 1):
      print('Heisei')
    else:
      print('TBD')

Submission status: Runtime Error

Solution code:
yy,dd,mm = int(input().split('/'))
x = 0
if(yy<=2019):
  if(mm<=4):
    if(dd<=30):
     x = 1

if(x == 1):
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
S = input()
year = int(S[:4])
month = int(S[4:8])

if year >= 2020 or year == 2019 and month >= 5:
    print("TBD")
else:
    print("Heisei")

Submission status: Runtime Error

Solution code:
s = input().replace('/','')
if s[4:5] == 1:
  print('TBD')
else:
  if s[5:6] > 4:
    print('TBD')
  else:
    print('Heisei')

Submission status: Runtime Error

Solution code:
s = input().replace('/','')
if s[4:5] == 1:
  return TBD
else:
  if s[5:6] > 4:
    return TBD
  else:
    return Heisei

Submission status: Runtime Error

Solution code:
a,b,q = map(int,input().split())
s = []
t = []
for i in range(a):
    k = int(input())
    s.append(k)
for i in range(b):
    k = int(input())
    t.append(k)


import bisect
import itertools
#sは配列,xは知りたい値
inf = 10**15
s = [-inf]+s+[inf]
t = [-inf]+t+[inf]
#最初と最後にinfをつけておく。

for i in range(q):
    x = int(input())
    asa = bisect.bisect_left(s,x)-1
    bs = bisect.bisect_left(t,x)-1
    s1,s2 = s[asa],s[asa+1]
    t1,t2 = t[bs],t[bs+1]
    ans = min(x-min(s1,t1),max(s2,t2)-x,
    s2-t1+min(s2-x,x-t1),
    t2-s1+min(t2-x,x-s1))
    print(ans)

Submission status: Runtime Error

Solution code:
list = S.split("/")
y = int(list[0])
m = int(list[1])
d = int(list[2])

if (y > 2019):
    print("TBD")
elif (y < 2019):
    print("Heisei")
elif (m > 4):
    print("TBD")
elif (m < 4):
    print("Heisei")
elif (d > 30):
    print("TBD")
else:
    print("Heisei")

Submission status: Runtime Error

Solution code:
def(S):

  list = S.split("/")
  y = int(list[0])
  m = int(list[1])
  d = int(list[2])

  if (y > 2019):
      print("TBD")
  elif (y < 2019):
      print("Heisei")
  elif (m > 4):
      print("TBD")
  elif (m <= 4):
      print("Heisei")

Submission status: Runtime Error

Solution code:
a = input().split('/')
a = list(map(int, a))
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')
a = input().split('/')
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
a = input().split('/')
if a[0] < 2019:
  print('Heisei')
elif a[1] < 5:
  print('Heisei')
else:
  print('TBD')

Submission status: Runtime Error

Solution code:
y,m,d = list(input().split("/"))
s = y+m+d

if s <= 20190430:
    print("Heisei")
else:
    print("TBD")

Submission status: Runtime Error

Solution code:
#   AtCoder Beginner Contest 119
#   problem A: Still TBD

S = input() #-> yyyy/mm/dd

date = S.split('/')

year = int(date[0])
month = int(date[1])
day = int(date[2])

if month >= 5:
    print('TBD')
elif:
    print('Heisei')

Submission status: Runtime Error

Solution code:
#   AtCoder Beginner Contest 119
#   problem A: Still TBD

S = input() #-> yyyy/mm/dd

date = S.split('/')

year = int(date[0])
month = int(date[1])
day = int(date[2])

if month >= 5:
    print('TBD')
elif
    print('Heisei')

Submission status: Runtime Error

Solution code:
import numpy as np

s = str(input())

y, m, d = s.split("/")

y, m, d = int(y), int(m), int(d)

if y < 2019:
  print("Heisei")
elif y==2019 and m<4:
  print("Heisei")
elif y==2019 and m=4 and d < 30:
  print("Heisei")
else:
  print("TBD")

Submission status: Runtime Error

Solution code:
s=str(input())
if int(s[0:4])*10000+int(str[5:7])*100+int(str[8:10])>20190430:
  print('TBD')
else:
  print('Heisei')

Submission status: Runtime Error

Solution code:
# N A B C
# l1
# l2
# ...

(N, A, B, C) = (int(input().split()[i]) for i in range(4))
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))

Submission status: Runtime Error

Solution code:
_,b,_=input().split('/')
print("Heisei"if b<5 else"TBD")

Submission status: Runtime Error

Solution code:
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (int(I[0]), I[1])
    X.append(x)
    U.append(u)

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Submission status: Runtime Error

Solution code:
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (int(I[0]), I[1])
    X[i] = x
    U[i] = u

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Submission status: Runtime Error

Solution code:
N = int(input())
X = []
U = []
for i in range(N):
    (x, u) = int(input().split())
    X[i] = x
    U[i] = u

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
if(int(a[5]) = 1):
    print("TBD")
elif(int(a[6]) > 4):
    print("TBD")
else:
    print("Heisei")

Submission status: Runtime Error

Solution code:
import bisect
import itertools
 
a, b, q = map(int, input().split())
ss, tt = [], []
for _ in range(a):
  ss.append(int(input()))
for _ in range(b):
  tt.append(int(input()))
  
for _ in range(q):
  x = int(input())
  md = pow(10, 15)
  xs, xt = bisect.bisect_left(ss, x), bisect.bisect_left(tt, x)
  ls, rs, lt, rt = ss[max(0, xs-1)], ss[min(a-1, xs)], tt[max(0, xt-1)], tt[min(b-1, xt)]
  for s, t in itertools.product([ls, rs], [lt, rt]):
    if s > t:
      if t > x:
        md = s - x if s - x < md else md
      elif s > x:
        if md > 2 * (s-x) + x-t:
          md = 2 * (s-x) + x-t
        if md > 2 * (x-t) + s-x:
          md = 2 * (x-t) + s-x
      else:
        md = x - t if x - t < md else md
    else:  # t > s
      if s > x:
        md = t - x if t - x < md else md
      elif t > x:
        if md > 2 * (x-s) + t-x:
          md = 2 * (x-s) + t-x
        if md > 2 * (t-x) + x-s:
          md = 2 * (t-x) + x-s
      else:
        md = x - s if x - s < md else md
  print(md)

Submission status: Runtime Error

Solution code:
import os
import sys
import datetime

def main():
    sDate = datetime.datetime.strptime("2019/04/30", '%Y/%m/%d')
    args = sys.argv
    argdate = ""

    if len(args) == 1:
        print("Error: invalid arguments.")
        return 2

    datestr = args[1]

    try:
        argdate = datetime.datetime.strptime(datestr, '%Y/%m/%d')
    except:
        print("Error: illegal date format.")
        return 1

    if argdate <= sDate:
        print("Heisei")
    else:
        print("TBD")

    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Runtime Error

Solution code:
from sys import stdin
import datetime
 
i = stdin.readline().strip()
d = map(int, i.split("/"))
print("Heisei" if d <= (2019,4,30) else "TBD")

Submission status: Runtime Error

Solution code:
from sys import stdin
import datetime

i = stdin.readline().strip()
d = datetime.date.fromisoformat("-".join(i.split("/")))
print("Heisei" if d < datetime.date.fromisoformat("2019-04-30") else "TBD")

Submission status: Runtime Error

Solution code:
from sys import stdin

i = stdin.readline().strip()
d = datetime.date.fromisoformat("-".join(i.split("/")))
print("Heisei" if d < datetime.date.fromisoformat("2019-04-30") else "TBD")

Submission status: Runtime Error

Solution code:
import pandas as pd
from sys import stdin

d = pd.to_datetime( stdin.readline().strip() )
print("TBD" if (d > pd.to_datetime("2019/4/30")) else "Heisei")

Submission status: Runtime Error

Solution code:
INF = int(1e18)

def compute():
    from sys import stdin
    A, B, Q = list(map(int, stdin.readline().split()))
    s = sorted(int(stdin.readline().split()[0]) for _ in range(A))
    t = sorted(int(stdin.readline().split()[0]) for _ in range(B))

    from bisect import bisect_left
    for _ in range(Q):
        x = int(stdin.readline().split()[0])

        i1 = bisect_left(s, x)
        i1 = i1 if i1 < A else i1-1
        i2 = i1-1 if (i1>0) and s[i1]!=x else i1

        res = INF
        for y in set((s[i1], s[i2])):
            j1 = bisect_left(t, y)
            j1 = j1 if (j1 < B) else j1-1
            j2 = j1-1 if (j1 > 0) and t[j1]!=y else j1
            for z in set((t[j1],t[j2])):
                # print(x, y, z)
                res = min(res, abs(x-y) + abs(y-z), abs(x-z) + abs(z-y))

        print(res)


if __name__ == "__main__":
    compute()

Submission status: Runtime Error

Solution code:
import pandas as pd
from sys import stdin

d = pd.to_datetime( stdin.readline().strip() )
print("TBD" if (d.gt(pd.to_datetime("2019/4/30"))) else "Heisei")

Submission status: Runtime Error

Solution code:

nen,mon,day = map(int,input().split('/'))

if nen >= 2019:
  if mon >= 5:  
    print("Heisei")
  else if day >= 30 and mon ==4:
    print("Heisei")
else:
    print("TBD")

Submission status: Runtime Error

Solution code:
a = input().split('/')
if a[0] > 2019 and a[1] > 5:
  print('TBD')
  
else:
  print('Heisei')

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input()split("/"))
print("Heisei" if b*10+c<=70 else "TBD")

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input()split("/"))
print("Heisei" if b*10+c>=70 else "TBD")

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
S=input()
if S[:5]<2019:
	print("Heisei")
elif S[:5]==2019&S[5]==0&S[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
S=input()
if S[:5]<2019:
	print("Heisei")
elif S[5]==0&S[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
S=input()
if S[5]==0&S[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
S=input()
if S[5]&S[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
S=input()
if S[5]==0&s[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
S=input()
if S[5]==0&&s[6]<5:
	print("Heisei")
else:
	print("TBD")

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    total = 0

    for line in range(0, n):
        total += calc()

    print(total)


def calc():
    x, u = map(str, input().split())

    if u == "JPY":
        return int(x)

    if u == "BTC":
        return float(x) * 380000


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    total = 0

    for line in range(0, n):
        total += calc(total)

    print(total)

def calc(total):
    x, u = map(str, input().split())

    if u == "JPY":
        total += int(x)
        return total

    if u == "BTC":
        total += float(x) * 380000
        return total


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s = input()
s = s.replace("/","")
print("Heisei" if s <= 20190430 else "TBD")

Submission status: Runtime Error

Solution code:
import datetime
 
t = datetime.datetime.strptime(input(), "%Y/%m/%d")
if t < (year=2019, month=5, day=1):
    print("Heisei")
else:
    print("TBD")

Submission status: Runtime Error

Solution code:
import datetime

t = datetime.datetime.strptime(input(), "%Y/%m/%d")
if t < (year=2019, month=5, day=1):
    print("Heisei")
else:
  	print("TBD")

Submission status: Runtime Error

Solution code:
n=int(input())
i=0
JPY=0
while n > i:
  i=i+1
  a,b=map(str,input().split())
  a = float(a)
  if b == "JPY":
    JPY=JPY+a
  else:
    JPY=JPY+a*380000
print(JPY)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  S = raw_input()
  Sdate = datetime.date(S.year, S.month)
  if Sdate <= datetime(2019, 4, 30):
    print('Heisei')
  else:
    print('TBD')

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  S = raw_input
  Sdate = datetime.date(S.year, S.month)
  if Sdate <= datetime(2019, 4, 30):
    return Heisei
  else:
    return TBD

Submission status: Runtime Error

Solution code:
#coding:utf-8
import bisect,sys
A,B,Q=map(int,raw_input().split())
s=[0]*A
t=[0]*B
for i in range(A):    
    s[i]=int(sys.stdin.readline())
for i in range(B):
    t[i]=int(sys.stdin.readline())
buf=[]
def f(x):
    sl=bisect.bisect_left(s,x)-1
    sr=sl+1
    tl=bisect.bisect_left(t,x)-1
    tr=tl+1
    ans=float("inf")
    if sl!=-1 and tl!=-1:
        A=max(s[sl],t[tl])
        B=min(s[sl],t[tl])
        L=abs(x-A)+abs(A-B)
        ans=min(ans,L)
    if sl!=-1 and tr!=len(t):
        L=abs(x-s[sl])*2 + abs(t[tr]-x)        
        ans=min(ans,L)
        ans=min(ans,abs(x-s[sl])+abs(t[tr]-x)*2)
    if tl!=-1 and sr!=len(s):
        ans=min(ans,abs(x-t[tl])*2+abs(s[sr]-x))
        ans=min(ans,abs(x-t[tl])+abs(s[sr]-x)*2)
    if tr!=len(t) and sr!=len(s):
        A=min(s[sr],t[tr])
        B=max(s[sr],t[tr])
        L=abs(A-x)+abs(B-A)
        ans=min(ans,L)
    return str(ans)

I=[0]*Q
for i in xrange(Q):
    I[i]=int(sys.stdin.readline())
r=map(f,I)
print("\n".join(r))

Submission status: Runtime Error

Solution code:
y = 0
for i in range(int(input())):
    x,u = input().split()
    y += int(x) if u == "JPY" else float(x)*380000
print(y)

Submission status: Runtime Error

Solution code:
y, m, d = int(input().split("/"))

if y < 2019:
    print("Heisei")
elif m <= 4 :
    print("Heisei")
else:
    print("TBD")

Submission status: Runtime Error

Solution code:
S = input()

print("Heisei" if S <= 2019/4/30 else "TBD")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;

  if (s <= "2019/04/30") {
    cout << "Heisei" << endl;
  } else {
    cout << "TBD" << endl;
  }
}

Submission status: Runtime Error

Solution code:
S = map(int, input().split("/"))
if S[1] > 4:
  print("TBD")
else:
  print("Heisei")

Submission status: Runtime Error

Solution code:
import numpy as np
    
INF = float('inf')

n,A,B,C = [int(i) for i in input().split()]

l = [int(input()) for i in range(n)]

def dfs(cur, a, b, c):
    
    if cur == n:
        return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a,b,c) > 0 else INF
    
    ret0 = dfs(cur+1, a, b, c)
    ret1 = dfs(cur+1, a+l[cur], b, c) + 10
    ret2 = dfs(cur+1, a, b+l[cur], c) + 10
    ret3 = dfs(cur+1, a, b, c+l[cur]) + 10

    return min(ret0, ret1, ret2, ret3)


print(dfs(0,0,0,0))

Submission status: Runtime Error

Solution code:
y,m,d = map(int,input().split(/))
if y<2019 or (y==2019 and m <= 4):
  print("Heisei")
else:
  print("TBD")

Submission status: Runtime Error

Solution code:
a=input().split('/')
a=a[0]+a[1]+a[2]:
if int(a) > 2019430
  print("TDB")
else:
  print('Heisei')

Submission status: Runtime Error

Solution code:
a=input().split('/')
a=a[0]+a[1]+a[2]
if int(a) > 2019430
  print("TDB")
else
  print('Heisei')

Submission status: Runtime Error

Solution code:
N = int(input())
M = [[i for i in input().split()] for i in range(N)]
C = 0

for i in range(N):
    if M[i][1] == 'JPY':
        C += int(M[i][0])
    elif M[i][1] == 'BTC':
        C += float(M[i][0])*380000

print(C)

Submission status: Runtime Error

Solution code:
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y)