Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << endl;
using LL=long long;
using VI=vector<int>;
using VL=vector<long long>;
using VS=vector<string>;
using VVI=vector<vector<int>>;
using PII=pair<int, int>;
const int inf = (int)1e9;
const LL mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

template <class T>void Sort(T & a) { sort(a.begin(), a.end()); }
template <class T>void ReSort(T& a) { sort(a.rbegin(), a.rend()); }
template <class T>void Reverse(T& a) { reverse(a.begin(), a.end()); }
template <class T>void Unique(T& a) { a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T>auto Max(T a) { return *max_element(a.begin(), a.end()); }
template <class T>auto Min(T a) { return *min_element(a.begin(), a.end()); }
template <class T, class U>int Count(T a, U c) { return count(a.begin(), a.end(), c); }
template<typename T>auto Sum(T a) { return accumulate(a.begin(), a.end(), iterator_traits<decltype(a.begin())>::value_type()); }

//INPUT//
void CINPUT() {}
template<class H, class ...T> void CINPUT(H&& h, T&& ...t) { cin >> h; CINPUT(forward<T>(t)...); }
#define in(...) int __VA_ARGS__; CINPUT(__VA_ARGS__);
#define IN(T,...) T __VA_ARGS__; CINPUT(__VA_ARGS__);

#define vin(name,n) int n; cin>>n; vector<T> name(n); for(auto &i : name)cin>>i;
#define vIn(name,n) vector<int> name(n); for(auto &i : name)cin>>i;
#define Vin(T,name,n) T n; cin>>n; vector<T> name(n); for(auto &i : name)cin>>i;
#define VIn(T,name,n) vector<T> name(n); for(auto &i : name)cin>>i;

#define vIn2(name,name2,n) vector<int> name(n),name2(n); rep(i,n)cin>>name[i]>>name2[i];
#define VIn2(T,name,name2,n) vector<T> name(n),name2(n); rep(i,n)cin>>name[i]>>name2[i];
#define VIN2(T,name,T2,name2,n) vector<T> name(n); vector<T2> name2(n); rep(i,n)cin>>name[i]>>name2[i];

//OUTPUT//
void print() { cout << endl; }
template <class H> void print(H&& h) { cout << h << endl; }
template <class H, class... T> void print(H&& h, T&& ... t) { cout << h << " "; print(forward<T>(t)...); }
template<class T>void out(T n) { cout << n << endl; }
template<class T>void out(vector<T> a, string sep = " ", string end = "\n") { for (int i = 0; i < (int)a.size(); ++i)cout << a[i] << (i == (int)a.size() - 1 ? end : sep); }
template<> void out(double a) { printf("%.20f\n", a); }
void yes(bool f) { puts(f ? "yes" : "no"); }
void Yes(bool f) { puts(f ? "Yes" : "No"); }
void YES(bool f) { puts(f ? "YES" : "NO"); }
void Yay(bool f) { puts(f ? "Yay!" : ":("); }
void poss(bool f) { puts(f ? "possible" : "impossible"); }
void Poss(bool f) { puts(f ? "Possible" : "Impossible"); }
void POSS(bool f) { puts(f ? "POSSIBLE" : "IMPOSSIBLE"); }

int main() {
	in(n);
	VIN2(double, x, string, u, n);
	
	vector<double> a(n);
	rep(i, n)a[i] = u[i] == "JPY" ? x[i] : x[i] * 380000.;
	out(Sum(a));
}

Compiler output:
a.cc: In instantiation of 'auto Sum(T) [with T = std::vector<double>]':
a.cc:66:9:   required from here
   66 |         out(Sum(a));
      |             ~~~^~~
a.cc:28:123: error: dependent-name 'std::iterator_traits<decltype (a.begin())>::value_type' is parsed as a non-type, but instantiation yields a type
   28 | template<typename T>auto Sum(T a) { return accumulate(a.begin(), a.end(), iterator_traits<decltype(a.begin())>::value_type()); }
      |                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
a.cc:28:123: note: say 'typename std::iterator_traits<decltype (a.begin())>::value_type' if a type is meant