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: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def readinput():
    n=int(input())
    dama=[]
    for _ in range(n):
        a,b=input().split()
        dama.append((a,b))
    return n,dama

def main(n,dama):
    sum=0.0
    for x,u in dama:
        if u=='JPY':
            sum+=int(x)
        else:
            sum+=float(x)*380000.0
    return sum

if __name__=='__main__':
    n,dama=readinput()
    ans=main(n,dama)
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ret = 0
for i in range(n):
    x, v = input().split()
    if v == 'JPY':
        ret += int(x)
    else:
        ret += float(x)*380000

print(ret)

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

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

    ans = 0
    rate = 380000.0
    for _ in range(N):
        x, u = readline().split()
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * rate

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
num = 0
for i in range(n):
    x1,v1 = map(str, input().split())
    if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000
print(num)

Submission status: Accepted

Solution code:
N=int(input())
xu=[]
for i in range(N):
    xu.append(list(map(str,input().split())))
a=0
for i in range(N):
    if xu[i][1]=='JPY':
        a+=float(xu[i][0])
    if xu[i][1]=='BTC':
        a+=float(xu[i][0])*(380000.0)
print(a)

Submission status: Accepted

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

ans = jpy+380000.0*btc
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
moneys = [tuple(map(str, input().split())) for _ in range(N)]
rate = 380000

total = 0
for money in moneys:
    x, u = money
    x = float(x)
    if u == 'JPY':
        total += x
    else:
        total += x * rate

print(total)

Submission status: Accepted

Solution code:
n = int(input())

p = 0

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
def iter_value_and_unit():
    for line in lines:
        value, unit = line.split(" ")
        value = float(value)
        if unit == "BTC":
            yield 380000.0 * value
        else:
            yield value

print(sum(iter_value_and_unit()))

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:
    ans += float(x) * 380000

print(ans)

Submission status: Accepted

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

ans=J+B*380000
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

money_sum = 0

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

Submission status: Accepted

Solution code:
N = int(input())
ans=0
for _ in range(N):
    xu=input().split()
    if xu[1]=="JPY":
        ans+=int(xu[0])
    else:
        ans+=float(xu[0])*380000
print(ans+0.000001)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
otoshidama = []
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        otoshidama.append(x)
    else:
        otoshidama.append(x*380000)
ans = sum(otoshidama)
print(f"{ans:.5f}")

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 += float(a)
	else:
		BTC += float(a)
print(JPY + 380000.0 * BTC)

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 += x * 380000.0

print(ans)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

n = int(input())
l = [list(map(str,input().split())) for i in range(n)]

ans = 0

for i in range(n):
    if l[i][1] == "JPY":
        ans += int(l[i][0])
    else:
        ans += float(l[i][0])*380000.0
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
u=[]
yen=0
bit=0
for i in range(n):
    a,b=input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i]
print(yen+380000*bit)

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 += 380000.0*x
    elif u == 'JPY':
        ans += x

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    s = 0
    for _ in range(n):
        x, u = input().split()
        if u == 'BTC':
            s += float(x) * 380000
        else:
            s += float(x) * 1
    print(s)
resolve()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

for _ in range(N):
    x,u = input().split()
    x = float(x)
    if u == 'BTC':
        ans += 380000*x
    else:
        ans += x

print(ans)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
J = 0
B = 0
for _ in range(N):
    x, u  = map(str, input().split())
    if u == 'JPY':
        J += int(x)
    else:
        B += float(x)
ans = J + 380000*B
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i], u[i] = map(str, input().split())

ans = 0
for i in range(N):
    if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
btc = 380000.0
a = 0
# 単位毎に加算する。
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        a += int(x)
    elif u == 'BTC':
        a += float(x)*btc
print(a)

Submission status: Accepted

Solution code:
n = int(input())
btc = 380000.0
a = 0
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        a += int(x)
    elif u == 'BTC':
        a += float(x)*btc
print(a)

Submission status: Accepted

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

money = 0

for k in xu:
    if k[1] == "JPY":
        money += float(k[0])
    else:
        money += float(k[0])*380000

print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
m = []
for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000)

print(sum(m))

Submission status: Accepted

Solution code:
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()
    m = [tuple(input().split()) for _ in range(n)]
    btc_to_jpy = 380000
    ans = 0
    for price, kind in m:
        if kind == 'JPY':
            ans += int(price)
        else:
            ans += btc_to_jpy * float(price)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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+=380000.0*x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sum = 0
for i in range(N):
    x, y = input().split()
    if(y == "JPY"):
        sum += float(x)
    else:
        sum += float(x)*380000.0
print(sum)

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":
    x=x*380000
  ans=ans+x
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A=[]
B=[]
for i in range(n):
    a,b = map(str,input().split())
    a = float(a)
    A.append(a)
    B.append(b)
    
for j in range(n):
    if B[j] == 'BTC':
        A[j] *=380000.0
print(sum(A))

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":
    x=x*380000
  ans=ans+x
print(ans)

Submission status: Accepted

Solution code:
price=0
for _ in range(int(input())):
  a,b=input().split()
  if b=='JPY': price+=float(a)
  else: price+=float(a)*380000
print(price)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#! python3
#  solve_119_B.py

N = int(input())
money = 0

for i in range(N):
    value,money_type = map(str,input().split())
    if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
        
print(money)

Submission status: Accepted

Solution code:
N = int(input())
cost = []
yen = []
for i in range(N):
    n, a = input().split()
    cost.append(float(n))
    yen.append(a)
ans = 0
for i in range(N):
    if yen[i] == "JPY":
        ans += cost[i]
    else:
        ans += cost[i] * 380000
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
total =0
for i in range(N):
  MM = input().split()
  if MM[-1] == 'JPY':
    total += float(MM[0])
  else:
    total += float(MM[0]) *380000
print(total)

Submission status: Accepted

Solution code:
N=int(input())
SUM=0
for i in range(N):
  x,u=input().split()
  x=float(x)
  if u=='BTC':
    x *= 380000.0
  SUM += x
print(SUM)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    x = []
    ans = 0
    for i in range(N):
        x.append(list(map(str, input().split(' '))))
    for i in range(N):
        if x[i][1] == 'BTC':
            ans = ans + (float(x[i][0])*380000)
        else:
            ans += float(x[i][0])
    print(ans)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
xu = []
ans = []
for i in range(n):
    XU = list(input().split())
    xu.append(XU)
for m, c in xu:
    if c == "JPY":
        ans.append(int(m))
    else:
        ans.append(float(m)*380000)
print(sum(ans))

Submission status: Accepted

Solution code:
btc_rate = 380000
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 * btc_rate
    
print(ans)

Submission status: Accepted

Solution code:
# abc119_b.py
# https://atcoder.jp/contests/abc119/tasks/abc119_b

# B - Digital Gifts /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 高橋くんは N人の親戚からお年玉をもらいました。
# N個の値 x1,x2,...,xN と N 個の文字列 u1,u2,...,uN が入力されます。
# 各文字列 ui は JPY または BTC であり、xi と ui が i人目の親戚からのお年玉の内容を表します。
# 例えば、x1=10000, u1= JPY であれば 1 人目の親戚からのお年玉は 10000 円であり、x2= 0.10000000, 
# u2= BTC であれば 2 人目の親戚からのお年玉は 0.1ビットコインです。
# ビットコインを 1.0BTC あたり 380000.0円として換算すると、高橋くんがもらったお年玉は合計で何円に相当するでしょうか？

# 制約
#     2≤N≤10
# ui=JPY または BTC
# ui=JPY のとき xi は整数であり、1≤xi≤10^8
# ui=BTC のとき xi は小数点以下の桁を 8 桁持つ小数であり、0.00000001≤xi≤100.00000000

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# x1 u1
# x2 u2
# :
# xN uN

# 出力
# 高橋くんが受け取ったお年玉が合計で Y円に相当するとき、値 Y(整数とは限らない) を出力せよ。
# 出力は、ジャッジの出力との絶対誤差または相対誤差が 10−5以下のとき正解と判定される。

# 入力例 1
# 2
# 10000 JPY
# 0.10000000 BTC

# 出力例 1
# 48000.0

# 1人目の親戚からのお年玉は 10000 円です。
# 2 人目の親戚からのお年玉は 0.1 ビットコインであり、1 BTC あたり 380000.0 円として換算すると 38000.0 円となります。
# これらの合計は 48000.0円です。

# なお、48000、48000.1 などと出力しても正解と判定されます。

# 入力例 2
# 3
# 100000000 JPY
# 100.00000000 BTC
# 0.00000001 BTC

# 出力例 2
# 138000000.0038

# この場合、138001000、1.38e8 などと出力しても正解と判定されます。


def calculation(lines):
    # line = lines[0]
    N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i+1]))

    result = 0
    for i in range(N):
        line = lines[i+1]
        if 'JPY' in line:
            result += int(line.replace(' JPY', ''))
        else:
            result += float(line.replace(' BTC', ''))*380000.0

    return [result]


# 引数を取得
def get_input_lines():
    line = input()
    N = int(line)
    lines = list()
    lines.append(line)
    for _ in range(N):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '10000 JPY', '0.10000000 BTC']
        lines_export = [48000.0]
    if pattern == 2:
        lines_input = ['3', '100000000 JPY', '100.00000000 BTC', '0.00000001 BTC']
        lines_export = [138000000.0038]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines()
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = yt + bt*380000
print(ans)

Submission status: Accepted

Solution code:
Row = int(input())
List = []
for i in range (Row):
  List.append(list(map(str, input().split())))
res = 0
for i in range(Row):
  if List[i][1] == "JPY":
    res += float(List[i][0])
  else:
    res += float(List[i][0])*380000
print(res)

Submission status: Accepted

Solution code:
n = int(input())
l = [input().split() for i in range(n)]

s= 0

for i in range(n):
    if l[i][1] == 'JPY':
        s+=float(l[i][0])
    else:
        s+=float(l[i][0])*380000.0
print(s)

Submission status: Accepted

Solution code:
n=int(input())
rate=380000
ans=0
for i in range(n):
    xi,ui=input().split()
    if ui=='JPY':
        ans+=int(xi)
    else:
        ans+=float(xi)*rate
print(ans)

Submission status: Accepted

Solution code:
# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
N = int(input())
en =0
bt =0
for i in range(N):
    a,b =input().split()
    if b =="JPY":
        en +=float(a)
    elif b =="BTC":
        bt +=float(a)
ans =en +bt *380000.0
print(ans)

Submission status: Accepted

Solution code:
j, b = 0, 0
for _ in range(int(input())):
    m, jb = input().split()
    if jb == "JPY":
        j += int(m)
    else:
        b += float(m)
print(j + 380000 * b)

Submission status: Accepted

Solution code:
N = int(input())
XU = [list(map(str,input().split())) for _ in range(N)]

ans = 0

for i in range(N):
    if XU[i][1] == "JPY":
        ans += float(XU[i][0])
    else:
        ans += 380000*float(XU[i][0])

print(float(ans))

Submission status: Accepted

Solution code:
n = int(input())
#d = {"JPY":0,"BTC":0}
x = 0
for i in range(n):
  a,u = input().split()
  a = float(a)
  if u=="JPY":
    x += a
  elif u=="BTC":
    x += (a*380000.0)
print(x)

Submission status: Accepted

Solution code:
N = int(input())
sm = 0
for i in range(N):
    m,c = input().split()
    m = float(m)
    if c == 'JPY':
        sm += m
    else:
        sm += m*380000.0
print(sm)

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)
    elif u == 'BTC':
        ans += float(x) * 380000
print(ans)

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  xy = [map(str, input().split()) for _ in range(n)]
  x, u = [list(i) for i in zip(*xy)]
  sum=0
  for i in range(0,n):
    if u[i]=='JPY':
      sum+=float(x[i])
    else:
      sum+=float(x[i])*380000
  print(sum)
  
main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
x_u = [input().split() for i in range(n)]

ans = 0
for x, u in x_u:
    if u == "JPY":
        ans += float(x)
    else:
        ans += float(x) * 380000.0
print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if xu[i][1] == "JPY":
            ans += int(xu[i][0])
        else:
            ans += (float(xu[i][0]) * 380000)
    print(ans)
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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
print(ans)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

# https://atcoder.jp/contests/abc119


def main():
    N = int(input())
    x, u = [None] * N, [None] * N

    for i in range(N):
        line = input().split()
        x[i], u[i] = float(line[0]), line[1]
    
    jpy = 0
    btc = 0.0
    for i in range(N):
        if u[i] == "BTC":
            btc += x[i]
        else:
            jpy += x[i]
    
    return jpy + 380000.0 * btc


print(main())

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())

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

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:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり

N = I()
xy = [LS() for _ in range(N)]

ans = 0
for i in range(N):
    x,y = xy[i]
    x = float(x)
    if y == 'JPY':
        ans += x
    else:
        ans += 380000*x

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = [input().split() for _ in range(N)]

ans = 0
for num, s in A:
    if s == 'JPY':
        ans += int(num)
    else:
        ans += 380000.0 * float(num)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
j = 0
b = 0

n = int(input())

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

Submission status: Accepted

Solution code:
s = 0
for i in range(int(input())):
    x, u = input().split()
    if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x)
print(s)

Submission status: Accepted

Solution code:
N = int(input())
X, U = [], []
T = 0
for _ in range(N):
  x, u = input().split()
  X.append(x)
  U.append(u)
for x, u in zip(X, U):
  if u == "JPY":
    T += int(x)
  else:
    T += float(x)*380000.0
print(T)

Submission status: Accepted

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

ans = 0
for dm in dms:
    if dm[1] == 'JPY':
        ans += float(dm[0])
    else:
        ans += float(dm[0]) * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
array = [ list(map(str,input().split())) for I in range(N) ]
# print(array)
for I in array:
    if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit()

amount = 0
for I in array:
    if I[1] == 'JPY': amount += int(I[0])
    if I[1] == 'BTC': amount += float(I[0]) * 380000

print(amount)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
xu = [input().split() for i in range(n)]
y = 0
b = 0
for j in xu:
  if j[1] == "JPY":
    y += int(j[0])
  else:
    b += float(j[0])
ans = y + 380000 * b
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
Price = 0
Rate  = 380000
for T in range(0,N):
    X,U = input().split()
    if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate
print(Price)

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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
ans = 0
for _ in range(n):
  a, b = rs()
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a)*380000
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
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0.0
for _ in range(n):
  arr = input().split()
  if arr[1]=="JPY":
    ans+=float(arr[0])
  else:
    ans+=float(arr[0])*380000.0

    
print(ans)

Submission status: Accepted

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