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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

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())
money, type = [], []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)

sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
money = []
type = []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)
    
sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)

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

Submission status: Accepted

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


calculate_yen = lambda xyi: int(xyi[0]) if xyi[1] == 'JPY' else float(xyi[0]) * 380000.0
calculate_total_yen = lambda xy : sum(map(calculate_yen, xy))

total = calculate_total_yen(xy)

print(total)

Submission status: Accepted

Solution code:

N = int(input())
xy = [input().split() for i in range(N)]


calculate_yen = lambda xyi: int(xyi[0]) if xyi[1] == 'JPY' else float(xyi[0]) * 380000.0
total = sum(map(calculate_yen, xy))

print(total)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
answer = 0
for _ in range(N):
    x, u = sr().split()
    if u == 'JPY':
        answer += int(x)
    else:
        answer += float(x) * 380000
print(answer)

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())
ans = 0
for _ 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:
N = int(input())

sum = 0.0
for _ in range(N):
    x,u = input().split()
    x = float(x)
    if u=="JPY":
        sum = x + sum
        continue
    x = 380000*x
    sum = sum + x
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
gifts = []
for i in range(n):
    gift = input().split()
    gifts.append(gift)
ans = 0
for j in range(n):
    if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    x, u=input().split()
    x=float(x)
    if u=="BTC":
        Y+=x*380000
    else:
        Y+=x

print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# ABC 119: B – Digital Gifts
N = int(input())

gift = 0

for _ in range(N):
    line = [s for s in input().split()]
    gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0])

print(gift)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# solution
import io

n = int(input())

array = [list(input().split()) for i in range(n)]

data = 0

for i in array:
  if i[1] == 'JPY':
    data += int(i[0])
  else:
    data += float(i[0])*380000.0
print(data)

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.0)

print(ans)

Submission status: Accepted

Solution code:
ans = 0
N = int(input())
for _ in range(N):
  x, y = input().split()
  if y == 'JPY':
    ans += int(x)
  else:
    ans += float(x) * 380000.0

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())
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())
t=0
c=0
for i in range(n):
  x,y=input().split()
  if y=='JPY':
    t+=int(x)
  else:
    c+=float(x)
print(t+c*380000)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
xy=[list(map(str,input().split())) for _ in range(n)]
ans=0
for i in range(n):
    if xy[i][1]=="BTC":
        ans+=380000*float(xy[i][0])
    else:
        ans+=float(xy[i][0])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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())
T = [input().split() for _ in range(n)]
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
gifts = [list(map(str, input().split())) for _ in range(N)]
ans = 0
for gift in gifts:
    if gift[1] == 'JPY':
        ans += int(gift[0])
    else:
        ans += float(gift[0])*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=='JPY':
    ans+=x
  else:
    ans+=x*380000

print(ans)

Submission status: Accepted

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

for i in range(n):
  if u[i]=='JPY':
    k+=x[i]
  else:
    b+=x[i]
    
b=b*380000
print(k+b)

Submission status: Accepted

Solution code:
print(sum(eval(input().replace(" JPY", "").replace(" BTC","*380000")) for _ in range(int(input()))))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
# list(map(int, input().split())

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

Submission status: Accepted

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

print(kozukai_sum)

Submission status: Accepted

Solution code:
N=int(input())

ans=0
for i in range(N):
    x,y=input().split()
    if y=='JPY':
        ans+=float(x)
    else:
        ans+=float(x)*38e4

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
import sys

n = int(input())
ans = 0
for _ in range(n):
	x, u = input().split()
	x = float(x)
	if u == "BTC":
		ans += x * 380000
	else:
		ans += 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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
  x,u = map(str, input().split())
  ans += float(x)*(1+(379999)*(u=="BTC"))
print(ans)

Submission status: Accepted

Solution code:
n =int(input())
x =[]
u =[]

for i in range(n):
    a, b =input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i] == "BTC":
        x[i] =x[i]*380000
print(sum(x))

Submission status: Accepted

Solution code:
n=int(input())
x=[list(input().split()) for i in range(n)]
cnt=0
for i in range(n):
    if x[i][1]=="BTC":
        cnt+=float(x[i][0])*380000
    else:
        cnt+=float(x[i][0])

print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
genkin=0
bit=0

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0.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:
n = int(input())
 
l = []
for i in range(n):
  s = input().split(" ")
  l.append((float(s[0]), s[1]))
 
r = 0
for val in l:
  r += val[0] if val[1] == "JPY" else val[0] * 380000
print(r)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    rate = 380000
    jpy = 0
    bit = 0
    for _ in range(N):
        x, u = input().split()
        if u=='JPY':
            jpy += float(x)
        else:
            bit += float(x)
    print(jpy + bit*rate)
main()

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
times = n
X = []
U = []
for _ in range(times):
    x,u = input().split()
    X.append(float(x))
    u = 1 if u == "JPY" else 380000
    U.append(u)

ans = np.dot(np.array(X),np.array(U))


print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II()
    BTC = 380000.0
    total = 0
    for i in range(n):
        v, t = IS().split()
        if t == 'JPY': total += int(v)
        elif t == 'BTC': total += float(v)*BTC
    print(total)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

x=[]
u=[]

for i in range(N):
    n, a = input().split()
    x.append(n)
    u.append(a)

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

print(sum)

Submission status: Accepted

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

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:
N = int(input())
gift = 0
for i in range(N):
  xu = input().split()
  x, u = float(xu[0]), xu[1]
  if u == "JPY":
    gift += x
  elif u == "BTC":
    gift += x * 380000
print(gift)

Submission status: Accepted

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


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())
p = 0
for i in range(n):
    x,u=input().split()
    if u=='JPY':
        p += int(x)
    else:
        p += (float(x)*380000)
print('{:.8f}'.format(p))

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

Submission status: Accepted

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

for i in range(n):
    x = input().split()
    if x[1] == "JPY":
        ans += float(x[0])
    else:
        ans += float(x[0])*380000

print(ans)

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ans = float(0)
    for n in range(N):
        x, u = sl()
        if u == 'JPY':
            ans += float(x)
        else:
            ans += float(x) * 380000.0
    print(ans)


if __name__ == '__main__':
    main()

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 += float(x)*380000
print(ans)
#print(*ans, sep='\n')

Submission status: Accepted

Solution code:
#ABC-119-B
N = int(input())
ans = 0
for _ in range(N):
    xi, ui = input().split()
    if ui == "JPY":
        ans += int(xi)
    else:
        ans += float(xi) * 380000.0
        
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for _ in range(n):
    x,y = input().split()
    if y == 'BTC':
        ans += 380000*float(x)
    else:
        ans += int(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  
print(ans)

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  BTC = 380000.0
  n = int(input())
  ans = 0
  for _ in range(n):
    x,u = input().split()
    if u == 'JPY':
      ans += float(x)
    elif u == 'BTC':
      ans += float(x) * BTC
      
  print(ans)
    
    
    
    
    
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    str_list = []
    for _ in range(n):
        str_list.append(list(input().split()))
        
    money_sum = 0
    for i in range(n):
        if str_list[i][1] == 'JPY':
            money_sum += int(str_list[i][0])
        else:
            money_sum += 380000 * float(str_list[i][0])

    print(money_sum)      

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
xu_list = [input().split() for _ in range(n)]
print(sum([int(x) if u == "JPY" else float(x) * 380000 for x, u in xu_list]))

Submission status: Accepted

Solution code:
N = int(input())

res = 0
for _ in range(N):
    x,u = input().split()
    if(u == 'JPY'):
        res += float(x)
    else:
        res += float(x) * 380000
print(res)

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  #s = input()
  #s = input().split("/")
  #a = list(map(int,input().split("")))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  for i in range(n):
    if a[i][1] == "JPY":
      ans += int(a[i][0])
    else:
      ans += 380000*float(a[i][0])
  print(ans)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
ans = 0
n = ii()

for i in range(n):
    x,u = ism()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x)*380000
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
xv=[]
for _ in range(N):
    xv.append(tuple(input().split()))
profit=0
for val in xv:
    if val[1]=='JPY':
        profit+=int(val[0])
    else:
        profit+=float(val[0])*380000.0

#print(N, xv)
print(profit)

Submission status: Accepted

Solution code:
N = int(input()) 
X = []
btc = 380000
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 += float(X[i][0]) * btc
    else:
        ans += int(X[i][0])
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)
    elif u =='BTC':
        ans += float(x)*380000.0

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
  I = input().split()
  if I[1] == 'JPY':
    A.append(int(I[0]))
  else:
    A.append(float(I[0]) * 380000.0)
print(sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
tmp = [input().split() for i in range(N)]
jpy = 0
btc = 0
for i in range(N):
    if tmp[i][1]=='JPY':
        jpy += int(tmp[i][0])
    elif tmp[i][1]=='BTC':
        btc += float(tmp[i][0])
print(jpy+btc*380000)

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
n = int(input())
btc = 380000
result = 0

for i in range(n):
    x,u = list(input().split())
    if u == 'BTC':
        result += float(x) * btc
    else:
        result += float(x)
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=0
    for i in range(n):
        a,b=STRM()
        if b=='JPY':
            ct+=int(a)
        else:
            ct+=float(a)*380000
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
n = int(input())

l = []
for i in range(n):
  s = input().split(" ")
  l.append((float(s[0]), s[1]))

r = 0
for val in l:
  r += val[0] if val[1] == "JPY" else val[0] * 380000
print(r)

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:
n=int(input())
X=0
for i in range(n):
    x, u = map(str,input().split())
    if u=="BTC":
        X+=float(x)*380000
    else:
        X+=float(x)
print(X)

Submission status: Accepted

Solution code:
N = int(input())
Yen = 0
Bit = 0

for i in range(N):
    x,u = input().split()
    x1 = float(x) 
    if u =="JPY":
        Yen += x1
    elif u == "BTC":
        Bit += x1

Yen +=Bit*380000

print(Yen)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    BTC = 380000.0
    N = int(input())
    res = 0
    for _ in range(N):
        x, u = input().split()
        x = float(x)
        if u == 'JPY':
            res += x
        else:
            res += BTC * x
    print(res)
    

main()

Submission status: Accepted

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

res = 0
for i in range(n):
    x, u = float(xu[i][0]), xu[i][1]
    if u == "JPY":
        res += x * 1
    else:
        res += x * 380000

print(res)

Submission status: Accepted

Solution code:
n = int(input())
y = 0.0
b = 0.0
for i in range(n):
    x, u = map(str, input().split())
    if u == "JPY":
        y += float(x)
    else:
        b += float(x)
print("{:.10f}".format(y + b * 380000.0))

Submission status: Accepted

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

Submission status: Accepted

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

    
print(sum)

Submission status: Accepted

Solution code:
N=int(input())
Num = []
Alp = []
for i in range(N):
    n, a = input().split()
    Num.append(float(n))
    Alp.append(a)
#print(Num)

ans=jp=bt = 0
for i in range(N):
  if Alp[i]=='JPY':
    jp += Num[i]
  if Alp[i]=='BTC':
    bt += Num[i]*380000.0
ans = jp + bt
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# coding: utf-8
import os
from sys import stdin, stdout

if(os.getenv('__LOCAL__')):
    __dirname = os.path.dirname(__file__)
    __basename = os.path.splitext(os.path.basename(__file__))[0]
    __inputname = './input/' + __basename + '.txt'
    __outputname = './output/' + __basename + '.txt'
    __input_path = os.path.join(__dirname, __inputname)
    __output_path = os.path.join(__dirname, __outputname)
    stdin = open(__input_path)
    # stdout = open(__output_path, "w")

def main():
    N = int(stdin.readline().rstrip())
    ans=0
    for _ in range(N):
        x, v = stdin.readline().rstrip().split(' ')
        x = float(x)
        if(v=="JPY"):
            ans+=x
        else:
            ans+=x*380000
    stdout.write("{}\n".format(ans))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = [0]*n
y = [0]*n

for i in range(n):
    x[i], y[i] = map(str, input().split())
ans = 0
for i in range(n):
    if y[i] == "JPY":
        ans += float(x[i])
    else:
        ans += float(x[i])*380000

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
m = [None]*N
for i in range(N):
    x,c = (input().split())
    if c == "JPY":
        m[i] = float(x)
    else:
        m[i] = float(x)*380000
print(sum(m))