CodeForces 785A Anton and Polyhedrons【水题】
原创
©著作权归作者所有:来自51CTO博客作者Richie_LL的原创作品,请联系作者获取转载授权,否则将追究法律责任
题目链接:http://codeforces.com/contest/785/problem/A
题意:给你n个立体图形,问你所有立体图形加起来有多少面
解析:水题,map处理直接做
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <set>
#include <stack>
#include <map>
using namespace std;
const int maxn = 3000+40;
map<string,int> ans;
int main()
{
int n;
scanf("%d",&n);
int sum = 0;
ans["Icosahedron"] = 20;
ans["Cube"]=6;
ans["Tetrahedron"]=4;
ans["Dodecahedron"]=12;
ans["Octahedron"]=8;
while(n--)
{
string x;
cin>>x;
sum+=ans[x];
}
cout<<sum<<endl;
return 0;
}