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:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Heisei")
    else:print("TBD")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s


n = ip()                              #入力整数1つ
#h,w= (int(i) for i in input().split())      #入力整数横2つ
#n,x,y = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
s = 0
for i in range(n):
    c = input().split()
    if c[1] == "JPY": s+= int(c[0])
    else :s += 380000.0 * float(c[0])
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

result = 0
for i in range(N):
    x, u = [i for i in input().split()]
    if u == "JPY":
        result += float(x)
    if u == "BTC":
        result += float(x) * 380000.0

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

Submission status: Accepted

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())
btc = 380000
cnt = 0
for _ in range(N):
  x, u = input().split()
  x = float(x)
  if(u == 'JPY'):
    cnt += x
  else:
    cnt += 380000*x
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())

yen = "JPY"
bi = 380000
ans = 0
for _ in range(N):
    a, b = input().split()
    if b == yen:
        ans += float(a)
    else:
        ans += float(a)*bi
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for i in range(N):
  x,s = input().split()
  x = float(x)
  if s == "BTC":
    res += x*380000
  else:
    res += x

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

print(ret)

Submission status: Accepted

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

print(suma)

Submission status: Accepted

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

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())
R = 380000.0
ans = 0
for i in range(N):
    x,u = input().split()
    x = float(x)
    if u == "BTC":
        x = x * R
    ans += x
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

btc = 380000.0

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    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)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
    mo,ye = input().split()
    if(ye == "JPY"):
        ans += int(mo)
    else:
        ans += float(mo)*380000
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("{:.10f}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

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

print(y)

Submission status: Accepted

Solution code:
N = int(input())
x = []
u = []
for _ in range(N):
    a, b = input().split()
    x.append(float(a))
    u.append(b)
ans = sum(t[0] if t[1] == 'JPY' else t[0] * 380000 for t in zip(x, u))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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)
    elif u == 'BTC':
        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())
    if u == "JPY":
        ans += int(x)
    else:
        ans += (float(x) * 380000)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
coeff = 380000.0
for _ in [0]*N:
    x, u = input().rstrip().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    elif u == 'BTC':
        ans += x * coeff
print('%.06f' % ans)

Submission status: Accepted

Solution code:
n = input()
val = 380000.0
ans = 0.0
for i in xrange(n):
	a,b = raw_input().split()
	a = float(a)
	if b == 'BTC':
		ans += a*val
	else:
		ans += a

print '%.9f' %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())
index=0
sum=0
while index < n:
    x, u = map(str, input().split())
    if u == "JPY":
        sum+=float(x)
    else:
        sum+=380000*float(x)
    index+=1
print(sum)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = int(input())
money = 0.0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'BTC':
        money += float(x) * 380000.0
    else:
        money += float(x)
print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
ANS=0
for i in range(N):
    x,u=input().split()

    if u[0]=="J":
        ANS+=int(x)
    else:
        ANS+=float(x)*380000

print(ANS)

Submission status: Accepted

Solution code:

def main():
    a = int(input())
    ans = 0
    for i in range(a):
        b = input().split()
        if b[1] == 'JPY':
            ans += int(b[0])
        else:
            ans += float(b[0]) * 380000

    print(ans)



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

Submission status: Accepted

Solution code:
N = int(input())
tot = 0
for i in range(N):
    l = list(input().split())
    l[0] = float(l[0])
    if(l[1] == "BTC"):
        l[0]*= 380000
    tot+=l[0]
print(tot)

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(N):
    money = input().split()
    if money[1] == "JPY":
        ans += int(money[0])
    else:
        ans += float(money[0])*380000
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)
    elif u=='BTC':
        btc+=float(x)
print(jpy+btc* 380000.0)

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())
x = [None] * N
u = [None] * N
for i in range(N):
    a, b = input().split()
    x[i] = float(a)
    u[i] = b

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

print(output)

Submission status: Accepted

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

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())
cnt = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        cnt += x
    else:
        cnt += 380000*x

print(cnt)

Submission status: Accepted

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

ans = 0
for content in xu_list:
    x_ , u_ = content
    if u_ == "JPY":
        ans += int(x_)
    else:
        ans += float(x_) * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
ans = 0
for _ in range(n):
    x, u = LS()
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

R = 0

for n in range(N):
    x, u = input().split()
    if u == 'JPY':
        R += float(x)
    else:
        R += float(x) * 380000.0

print(R)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(otoshidama)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python2
"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import itertools
import os
import sys
from atexit import register
from io import BytesIO


class dict(dict):
    """dict() -> new empty dictionary"""

    def items(self):
        """D.items() -> a set-like object providing a view on D's items"""
        return dict.iteritems(self)

    def keys(self):
        """D.keys() -> a set-like object providing a view on D's keys"""
        return dict.iterkeys(self)

    def values(self):
        """D.values() -> an object providing a view on D's values"""
        return dict.itervalues(self)


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


range = xrange

filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))

input = lambda: sys.stdin.readline().rstrip('\r\n')


def main():
    n = int(input())
    worth = 0

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

    print(worth)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

print(total)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

btc = 380000

n = ni()

ans = 0
for _ in range(n):
    s = ls()
    num = float(s[0])
    typ = s[1]
    
    if typ == "JPY":
        ans += num
    else:
        ans += num * btc
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

xuList = []
for i in range(N):
    x, u = input().split()
    x = float(x)
    xuList.append((x,u))

BTCRate = 380000.0

result = 0
for x, u in xuList:
    if u == 'JPY':
        result += x
    else:
        result += (BTCRate * x)

print(result)

Submission status: Accepted

Solution code:
ans = 0
n = int(input())
RATE = 380000
for _ in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * RATE
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:
n = int(input())
ans = 0
d = { 'JPY': 1, 'BTC': 380000.0}
for _ in range(n):
  a, b = input().split()
  ans += float(a) * d[b]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
N=int(input())
btc=380000
ans=0
for i in range(N):
    a,b=input().split()
    if(b=='JPY'):
        ans+=int(a)
    else:
        ans+=btc*float(a)


print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = []
for i in range(N):
  L.append(list(input().split()))
Y = 0
B = 0
for i in range(N):
  if L[i][1] =='JPY':
    Y +=float(L[i][0])
  else:
    B +=float(L[i][0])
print(Y+B*380000)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N, XUs):
    p = 380000.0
    ans = 0
    for x, u in XUs:
        if u == "BTC":
            ans += float(x) * p
        else:
            ans += float(x)
    return ans


if __name__ == "__main__":
    N = int(input())
    XUs = list(tuple(input().split(" ")) for _ in range(N))
    print(solve(N, XUs))

Submission status: Accepted

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

ans = 0
N = int(input())
for n in range(N):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * 380000.0
print("{:.9f}".format(ans))

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for i in range(N):
    x, u = input().split()
    x = float(x)

    if u == 'BTC':
        x *= 380000

    res += x

print('{:.12f}'.format(res))

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

Submission status: Accepted

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

for i in range(N):
    x,u = X[i]
    if u == "JPY":
        ans += float(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 = 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,y = input().split()
    x = float(x)
    if y == "JPY":
        ans += x
    else:
        ans += 380000.0*x
print(ans)

Submission status: Accepted

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

result = 0

for x, u in XU:
    if u == "JPY":
        r = float(x)
    else:
        r = float(x) * 380000.0
    result += r

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
s=0
l=0
ans=0
for i in range(a):
    ta,tb = map(str,input().split()) 
    if tb =="JPY":s+=int(ta)
    else:s+=float(ta)*380000


print(s)

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("%.10f" % ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Runtime Error

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*int(x)
print(s)

Submission status: Runtime Error

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[i])
    else:
        kei += float(x[i])*380000.0
print(kei)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
kei = 0.0
for i in range (n):
    x,u=list(map(input().split()))
    if u[i]=='JPY':
        kei += float(int(x[i]))
    else:
        kei += float(x[i])*380000
print(kei)

Submission status: Runtime Error

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

Submission status: Runtime Error

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+int(b[i][0])*380000
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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+=i
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = [input().split() for i,c in range(n)]
sum =0
for i,c in l:
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
l = [list(input().split()) for i,c in range(n)]
sum =0
for i,c in l:
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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)
resole()

Submission status: Runtime Error

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

Submission status: Runtime Error

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, M = list(map(int, line.split()))
    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: Runtime Error

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 += int(List[i][0])
  else:
    res += int(List[i][0])*380000
print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

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