Problem:


Score : 200 points

Problem Statement

Takahashi received otoshidama (New Year's money gifts) from N of his relatives.

You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.

For example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.

If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Constraints

2 \leq N \leq 10

u_i = JPY or BTC.

If u_i = JPY, x_i is an integer such that 1 \leq x_i \leq 10^8.

If u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000.

Input

Input is given from Standard Input in the following format:

N
x_1 u_1
x_2 u_2
:
x_N u_N

Output

If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).

Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.

Sample Input 1

2
10000 JPY
0.10000000 BTC

Sample Output 1

48000.0

The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.

Outputs such as 48000 and 48000.1 will also be judged correct.

Sample Input 2

3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Sample Output 2

138000000.0038

In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Wrong Answer

Solution code:
N=int( input() )
#XU= []
X=[]
for i in range(N):
    x,u = input().split() # x: 100 u: JPY
    if u=="JPY":
        x=float(x)
    else:
        x=float(x)
        x=x*38000
    #XU.append( [x, u] )
    X.append(x)

print(sum(X))

Submission status: Wrong Answer

Solution code:
N = int(input())
X = [input().split() for _ in range(N)]

Y = 0
for i in X:
    print(i[1])
    if i[1] == 'JPY':
        Y += int(i[0])
    elif i[1] == 'BTC':
        Y += (380000.0 * float(i[0]))

print(Y)

Submission status: Wrong Answer

Solution code:
N=int(input())
OTOSHIDAMA=0

for i in range(0,N):
  A,B=(input().split(" "))
  AA=float(A)
  if B=="BTC":
    AA=AA*380000
  
  OTOSHIDAMA+=AA
  print(OTOSHIDAMA)
  
print(OTOSHIDAMA)

Submission status: Wrong Answer

Solution code:
RATE = 380000.0;
N = int(input());

sum = 0;
for i in range(N):
    s = input().split(" ");
    if s[1] == "BTC":
        sum = sum + float(s[0])*RATE;
    else:
        sum = sum + float(s[0]);

print(int(sum))

Submission status: Wrong Answer

Solution code:
num_people = int(input())
dic = {}
for i in range (num_people):
    usr_input = input()
    lst = usr_input.split()
    a = float(lst[0])
    b = lst[1]
    dic[a]=b
total = 0
for amount, currency in dic.items():
    if currency == 'BTC':
        total += amount*380000.0
    else:
        total += amount
print(total)

Submission status: Wrong Answer

Solution code:
num_people = int(input())
dic = {}
for i in range (num_people):
    usr_input = input()
    lst = usr_input.split()
    a = float(lst[0])
    b = lst[1]
    dic[a]=b
total = 0
for amount, currency in dic.items():
    if currency == 'BTC':
        total += amount*380000.0
    else:
        total += amount
print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
yen = []
for i in range(N):
    xi, ui = input().split()
    xi = float(xi)
    if ui == "BTC":
        ui = 380000
    else:
        ui = 1
    yen.append(xi*ui)
print(int(sum(yen)))

Submission status: Wrong Answer

Solution code:
n = int(input())
gifts = [list(input().split()) for _ in range(n)]
gifts = [float(x) if u == 'BTC' else float(x) * 380000.0 for x, u in gifts]
print(sum(gifts))

Submission status: Wrong Answer

Solution code:
n=int(input())
xu=dict(map(str,input().split()) for i in range(n) )
s=[]
b=[]
for key,val in xu.items():
    if val=="JPY":
        s.append(float(key))
    else:
        b.append(float(key))
print(sum(s)+(sum(b)*380000.0))

Submission status: Wrong Answer

Solution code:
n=int(input())
xu=dict(map(str,input().split()) for i in range(n) )
s=[]
b=[]
for key,val in xu.items():
    if val=="JPY":
        s.append(float(key))
    else:
        b.append(float(key))
print(sum(s)+(sum(b)*380000))

Submission status: Wrong Answer

Solution code:
N = int(input())
money = []
for i in range(N):
    money.append(input().split())

B2Y = 38000.0

otoshidama = 0

for item in money:
    if item[1] == 'JPY':
        otoshidama += float(item[0])
    else:
        otoshidama += float(item[0])*B2Y

print(otoshidama)

Submission status: Wrong Answer

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))

N=ri()
ans = 0
rate = 38000.0
for i in range(N):
    x,u=input().split()
    x = float(x)
    ans += x if u=='JPY' else x*rate

print("{:5f}".format(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = 380000.0
ans = 0.0
for i in range(N):
  x,u = input().split()
  x = float(x)
  ans += x * rate if u == 'BTC' else x
  print('{:.11f}'.format(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n):
  m, curr=input().split()
  m=float(m)
  curr=str(curr)
  a=0
  if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m
print(a)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
 
def solve():
	n = int(input())
 
	sum = Decimal("0")
	for i in range(n):
		amount, type = input().split()
		if type == "JPY":
			sum += Decimal(amount)
		else:
			sum += Decimal(amount)*Decimal("380000.0")
	return sum

Submission status: Wrong Answer

Solution code:
a = int(input())

b = []
for i in range(a):
    c = input().split(' ')
    b.append(c)

total = 0
for j in range(a):
    if b[j][1] == 'JPY':
        total += int(b[j][0])
    else:
        total += int(float(b[j][0]) * 380000)

print(total)

Submission status: Wrong Answer

Solution code:
ninzu=input()
dama_sum=0

for a in range(int(ninzu)):
    dama=input()
    dama_spl=dama.split(" ")
    if dama_spl[1]=="JPY":
        r=1
    else:
        r=380000
    dama_sum += float(dama_spl[0])*r
dama_sum

Submission status: Wrong Answer

Solution code:
N = int(input())
money = 0
for i in range(N):
    x, u = list(input().split(' '))
    if(u == 'JPY'):
        rate = 1.0
    else:
        rate = 380000.0
    money += int(float(x) * rate)
print(money)

Submission status: Wrong Answer

Solution code:
a=int(input())

res = float(0.0)

for i in range(a):
  b=input().split()
  if b[1] == "JPY":
    res += float(b[0])
  if b[1] == "BTC":
    res += float(b[0])*38000

print(res)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
def calc(total):
    x, u = input().split()

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

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


if __name__ == '__main__':
    N = int(input())
    total = 0
    
    for line in range(0,N):
        calc(total)
    print(total)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
vs = np.zeros(N)
for i in range(N):
    x,u = input().split()
    if u == "BTC":
        vs[i] = float(x)*380000.0
    elif u == "JPY":
        vs[i] = int(x)
sum_v = vs.sum()
print("{:.1f}".format(sum_v))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
 
def solve():
	n = int(input())
 
	sum = Decimal("0")
	for i in range(n):
		amount, type = input().split()
		if type == "JPY":
			sum += Decimal(amount)
		else:
			sum += Decimal(amount)*Decimal("380000.0")
	return sum

Submission status: Wrong Answer

Solution code:
a=int(input())
b=0
for c in range(a):
  d=input().split()
  if d[1] == 'BTC':
    c=c+380000*float(d[0])
  else:
    c=c+int(d[0])
print(c)

Submission status: Wrong Answer

Solution code:
print(sum(616.441400297**2**("B"in i)*float(i[:-4])for i in open(0).readlines()[1:]))

Submission status: Wrong Answer

Solution code:
N = int(input())

x = []
u = []
for _ in range(N):
  inp = input().split(' ')
  if inp[1] == 'JPN':
    x.append(int(inp[0]))
  else:
    x.append(float(inp[0]))
  u.append(inp[1])

sum = 0

for i in range(N):
  sum += x[i]

print(sum)

Submission status: Wrong Answer

Solution code:
N = input()

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 0
for i in range(N):
    x, y = map(str, input().split())
    x = float(x)
    if y == "BTC":
        m += x * 380000.0
    else:
        m += x

Submission status: Wrong Answer

Solution code:
a = int(input())
i = 0
b = []
for i in range(a):
    b.append(input().split())

print(b)
money_bit_all = 0
money_all = 0

for i in range(a):
    money_bit = 0
    if 'BTC' in b[i]:
        money_bit = 380000.0 * float(b[i][0])
        money_bit_all = money_bit_all + money_bit

    else:
        money_all = money_all + float(b[i][0])

print(money_all + money_bit_all)

Submission status: Wrong Answer

Solution code:
N=int(input())
list = []
for i in range(N):
  list1 = input()
  list.append(list1)

sum = 0.0
bin = 0.0
for i in range(len(list)):
  if list[i][1] == "JPY":
    sum += float(list[i][0])
  else:
    bin += float(list[i][0])
all = sum + (bin * 380000.0)
print(all)

Submission status: Wrong Answer

Solution code:
import math
from sys import stdin

N = input()
total = 0
for i in range(int(N)):
  x, u = stdin.readline().rstrip().split() 
  if u=='JPY':
    total=float(x)+total
  else:
    total += float(380000*float(x))
      
print('%d'%int(total))

Submission status: Wrong Answer

Solution code:
#お年玉の合計を記録する変数
moneyTotal = 0
# お年玉を貰った数を入力
moneyCount = int(input())
# 受け取った数だけ入力を受け付ける
for i in range(moneyCount):
    # 金額と単位で入力
    money = input()
    # 金額と単位を分割
    moneyInfo = money.split()
    # 金額取得
    moneyAmount = moneyInfo[0]
    # 単位取得
    moneyUnit = moneyInfo[1]
    if moneyUnit == "JPY":
        # 日本円で合計値を加算
        moneyTotal += int(moneyAmount)
    if moneyUnit == "BTC":
        # 1BTC = 380000.0円で加算
        moneyTotal += int(float(moneyAmount) * 380000.0)
print(moneyTotal)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
btc = 380000.0
y = 0.0
for i in range(int(input())):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
         y += y + x * btc
    else:
        y += x

print(y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
btc = 380000.0
y = 0.0
for i in range(int(input())):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
         y = y + x * btc
    else:
        y = x

print(y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
btc = 380000.0
y = 0.0
for i in range(int(input())-1):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
         y = y + x * btc
    else:
        y = x
print(y)

Submission status: Wrong Answer

Solution code:
sum41 = 0
n = int(input())
for _ in range(n):
	tmp = input().split(' ')
	print(tmp)
	sum41 += float(tmp[0]) if tmp[1] == 'JPY' else float(tmp[0]) * 380000
	print(sum41)

print(1.0 * sum41)

Submission status: Wrong Answer

Solution code:
N=int(input())
s=[input().split() for i in range(N)]
M=0
print(s)
for i in range(N):
  p=int(i)
  if s[p][1]=="JPY":
    M=M+float(s[p][0])
  else:
    M=M+float(s[p][0])*380000.0
print(M)

Submission status: Wrong Answer

Solution code:
import math
from sys import stdin

N = input()
total = 0
for i in range(int(N)):
  x, u = stdin.readline().rstrip().split() 
  if u=='JPY':
    total=float(x)+total
  else:
    total += 380000*float(x)
      
print('%.1f'%total)

Submission status: Wrong Answer

Solution code:
sum41 = 0
n = int(input())
for _ in range(n):
	tmp = input().split(' ')
	sum41 += float(tmp[0]) if tmp[1] == 'BTC' else float(tmp[0]) * 380000

print(1.0 * sum41)

Submission status: Wrong Answer

Solution code:
data = input().split()[1:]

sum = 0.0
for i in range(0, len(data), 2):
	if data[i+1] == "JPY":
		sum += int(data[i])
	elif data[i+1] == "BTC":
		sum += float(data[i]) * 380000.0
		
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = []
u = []
Y = 0
for i in range(N):
    s = [i for i in input().split()]
    print(s)
    x.append(float(s[0]))
    u.append(s[1])

    if u[i] == 'BTC':
        Y += x[i]*380000
    else:
        Y += x[i]

print(Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0

for _ in range(n):
    a = list(map(str, input().split()))
    if a[1] == "JPY":
        ans += int(a[0])
    else:
        ans += float(a[0]) * 380000

print(int(ans))

Submission status: Wrong Answer

Solution code:
import re
otoshidama = 0

N = int(input())

for i in range(0,N):
  ni = re.split('\s+', input())
  if(ni[1] == 'BTC'):
    otoshidama += (float(ni[0]) * 38000.00)
  else:
    otoshidama += int(ni[0])
  
print(otoshidama)

Submission status: Wrong Answer

Solution code:
import re
otoshidama = 0

N = int(input())

for i in range(0,N):
  ni = re.split('\s+', input())
  if(ni[1] == 'BTC'):
    ni[0] = float(ni[0]) * 38000
  otoshidama += float(ni[0])
  
print(otoshidama)

Submission status: Wrong Answer

Solution code:
import sys
from decimal import Decimal


def solution(nominals, currency):
    result = 0
    for value, c in zip(nominals, currency):
        if c =="JPY":
            result += value
        else:
            result += 380000.0 * value
    return result



nominals, currencies = [], []
for i,line in enumerate(sys.stdin):
    if i == 0:
        cases = int(line)
    if i == 1:
        n, c = line.split(' ')
        nominals.append(float(n))
        currencies.append(c)

print(solution(nominals, currencies))

# print(solution([10000, 0.1], ['JPY', 'BTC']))
# print(solution([100000000 , 100.00000000, 0.00000001 ], ['JPY', 'BTC', 'BTC']))

Submission status: Wrong Answer

Solution code:
N = int(input())
EBTC = 380000.0
R = 0
for i in range(N):
    t = [x for x in input().split()]
    R = R + float(t[0]) if t[1]=="JPY" else R + float(t[0])*EBTC
print(int(R))

Submission status: Wrong Answer

Solution code:
N = int(input())
otoshidama = {}
for i in range(N):
    x,u = input().split()
    if u=="JPY":
        x = int(x)
    else:
        x = float(x)
    otoshidama[u] = x
#print(otoshidama)

summoney = 0
for i in otoshidama:
    if i == "JPY":
        summoney += otoshidama[i]
    else:
        summoney += otoshidama[i]*380000.0
print(summoney)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(n):
    p = input().split()
    
    if p[1] == 'JPY':
        ans += int(p[0])
    else:
        ans += int(float(p[0])*380000.0)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[list(input().split())for i in range(n)]
print(a)
total=0
for i in range(n):
    if a[i][1]=="JPY":
        total+=int(a[i][0])
    elif a[i][1]=="BTC":
        total+=float(a[i][0])*380000
print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
list_m = [input().split() for _ in range(N)]

money = 0
for i in range(N):
  if list_m[i][1] == 'JPY':
    money += float(list_m[i][0])
  else:
    money += float(list_m[i][0])*380000.0
print(int(money))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
sum = 0
for i in range(int(N)):
    s = input()
    money = float(s.split()[0])
    unit = s.split()[1]
    if unit == "JPY":
        sum += money
    else:
        sum += money * 3.8 * (10**5)

print("{:.1f}".format(sum))

Submission status: Wrong Answer

Solution code:
N = int(input())
EBTC = 380000.0
R = 0
for i in range(N):
    t = [x for x in input().split()]
    R = R + int(t[0]) if t[1]=="JPY" else R + float(t[0])*EBTC
print(int(R))

Submission status: Wrong Answer

Solution code:
N=int(input())
kanes=[[u for u in input().split()] for _ in range(N)]

anss=0
for kane in kanes:
    if kane[1]=='BTC':
        anss+=int(float(kane[0])*380000)
    else:
        anss+=int(kane[0])

print(anss)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
    a, b = input().split()
    a = float(a)
    if (b == 'JPY'):
        ans += a;
    else:
        ans += a * 38000
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    y = 0
    N = int(input())
    for _ in range(N):
        x = float(input().strip().split(' ')[0])
        y += x

    print(y)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = input()
sum = 0
for i in range(int(N)):
    s = input()
    money = float(s.split()[0])
    unit = s.split()[1]
    if unit == "JPY":
        sum += money
    else:
        sum += money * 3.8 * (10**5)
sum = int(sum)
print("{:.1f}".format(sum))

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        ans += int(x)
    else:
        ans += int(float(x) * 380000 + 0.1)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
otoshidama = 0
for i in range(N):
    x,u = map(str,input().split())
    x = float(x)
    if u == "JPY":
        otoshidama += x
    elif u == "BTC":
        otoshidama += int(x * 380000)
    
print(otoshidama)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(N):
  x, u = input().split()
  if u == "BTC":
    ans += int(float(x) * 3.8 * (10**5))
  else:
    ans += int(x)
print(ans)

Submission status: Wrong Answer

Solution code:
def inpl():
    return list(map(int, input().split()))


N = int(input())
ans = 0.0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += 380000 * x
print(ans)
print("{:.10f}".format(ans))

Submission status: Accepted

Solution code:
n=int(input())
x_list=[]
u_list=[]
for i in range(n):
  x,u=input().split()
  x_list.append(float(x))
  u_list.append(u)
sum=0
for i in range(n):
  if u_list[i]=="JPY":
    sum+=x_list[i]
  else:
    sum+=x_list[i]*380000.0
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
list_bonus = [[s for s in input().split()] for j in range(0, n)]
ans = 0.0
for i in range(0, n):
    if list_bonus[i][1] == "JPY":
        ans += float(list_bonus[i][0])
    else:
        ans += float(list_bonus[i][0]) * 380000.0
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

j, b = 0, 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        j += x
    else:
        b += x
print(j + b*380000)

Submission status: Accepted

Solution code:
n = int(input())
xu = [list(input().split()) for i in range(n)]
ans = 0
for i in range(n) :
    xu[i][0] = float(xu[i][0])
    if xu[i][1] == "JPY" :
        ans += xu[i][0]

    else :
        ans += xu[i][0]*380000

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

result = 0

for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
    
print(result)

Submission status: Accepted

Solution code:
n = int(input())

ab = [list(input().split()) for _ in range(n)]
jpy =0
btc =0

for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0])

print (jpy + btc *380000.0)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(n):
    x, u = input().split()

    if u == 'JPY':
        ans += float(x)
    else:
        ans += float(x) * 380000.0

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
D={'JPY':1, 'BTC':380000}
a=0
for _ in range(N):
  v,s=list(input().split())
  a+=float(v)*D[s]
print(a)

Submission status: Accepted

Solution code:
n = int(input())
c = 0
for i in range(n):
    y, t = input().split()
    if t == 'BTC':
        yen = float(y)*380000.0
    else:
        yen = float(y)
    c += yen

print(c)

Submission status: Accepted

Solution code:
# B Digital Gifts
N = int(input())
X = [list(map(str, input().split())) for _ in range(N)]
gifts = 0
for i in range(N):
    if X[i][1] == 'JPY':
        gifts += int(X[i][0])
    else:
        gifts += float(X[i][0]) * 380000
print(gifts)

Submission status: Accepted

Solution code:
n=int(input())

s=0

for i in range(n):
    a,u=input().split()
    if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
        
print(s)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ind = x.index('.')
        ans += int(x[:ind]) * 380000
        ans += int(x[ind+1:]) * 38 / 10000

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0.0
rate = 380000.0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    ans += float(a)
  else:
    ans += (float(a)*rate)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = float(0)
for _ in range(n):
  m, u = input().split()
  m = float(m)
  if u == 'JPY':
    ans += m
  else:
    ans += m * float(380000)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
s=0
for i in range(N):
    x,u=map(str,input().split())
    if u=='JPY':
        s+=int(x)
    else:
        s+=380000.0*float(x)
print(s)

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))
  

def Vector(line):
    return mapt(Atom, line.split(" "))


def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment

def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total)

main()

Submission status: Accepted

Solution code:
n=int(input())
m=[list(map(str,input().split())) for i in range(n)]

cnt=0

for i in range(n):
  m[i][0]=float(m[i][0])
  if m[i][1]=='BTC':
    m[i][0]*=380000.0
  cnt+=m[i][0]

print(cnt)

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
n=int(input())
xu=[list(input().split()) for _ in range(n)]

result = 0
for i in range(n):
  if xu[i][1] == 'JPY':
    result += int(xu[i][0])
  else:
    result += float(xu[i][0]) * 380000
print(result)

Submission status: Accepted

Solution code:
n = int(input())
list = []
for i in range(n):
    a,b=input().split()
    list.append([float(a), b])
ans=0
for i in range(n):
    if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for x, u in zip(X, U):
    if u == 'JPY':
        ans += x
    else:
        ans += x*380000.
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(n):
    x,u=input().split()
    if u=='JPY':
        ans+=int(x)
    else:
        ans+=float(x)*380000.0
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000
print(c)

Submission status: Accepted

Solution code:
n = int(input())
a = 0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        a += int(x)
    else:
        a += float(x) * 380000
print(a)

Submission status: Accepted

Solution code:
N = int(input())
btc_a = 380000.0
btc_b = btc_a / (10 ** 8)
ans = 0.0
for i in range(N):
  x, n = input().split()
  if n == "JPY":
    ans += int(x)
  else:
    a, b = map(int, x.split("."))
    ans += a * btc_a
    ans += b * btc_b
print(ans)

Submission status: Accepted

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

    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            gift += int(x)
        else:
            gift += float(x) * 380000

    print(gift)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = 0
for i in range(n):
  v, c = input().split()
  v = float(v)
  if c == "JPY":
    a += v
  else:
    a += v * 380000.0
print(a)

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":
        ans+=int(a)
    else:
        ans+=float(a)*380000.0

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
sum=0
for j in range(n):
  i,c=input().split()
  if c=="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
total = 0
for i in range(n):
    value, currency = input().split()
    if currency == 'JPY':
        total += float(value)
    else:
        total += float(value) * 380000
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

jpy = 0
btc = 0

for _ in range(N):
  x,u = input().split()
  if u == "JPY":
    jpy += int(x)
  else:
    btc += float(x)
    
print(jpy + btc*380000)

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

num = int(input())
total = 0
for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0
print(total)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
b = 380000.0
for i in range(N):
  s = list(input().split())
  if s[1] == "JPY":
    ans += int(s[0])
  else:
    ans += float(s[0]) * b
print(ans)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    xu = [LSS() for _ in range(N)]

    ans = 0
    for x, u in xu:
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * 380000

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    if u=="BTC":
        ans += x*380000.0
    else:
        ans += x
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
x=[]
for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000)
print(sum(x))

Submission status: Accepted

Solution code:
n = int(input())
jpy = 0
btc = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000)
print(jpy+(btc*38/10000))

Submission status: Accepted

Solution code:
n = int(input()) 
y = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        y += int(x)
    if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0
print(y)

Submission status: Accepted

Solution code:
bit = 380000.0

n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * bit
print(ans)

Submission status: Accepted

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