【题目链接】:http://codeforces.com/contest/785

【题意】



给你各种形状的物体;

然后让你计算总的面数;

【题解】



用map来记录各种物体本该有的面数;

读入各种物体;

然后累加各种物体的面数;

然后输出就好;



【完整代码】

#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define rei(x) scanf("%d",&x)
#define rel(x) scanf("%lld",&x)
#define ref(x) scanf("%lf",&x) typedef pair<int, int> pii;
typedef pair<LL, LL> pll; const int dx[9] = { 0,1,-1,0,0,-1,-1,1,1 };
const int dy[9] = { 0,0,0,-1,1,-1,1,-1,1 };
const double pi = acos(-1.0);
const int N = 110; string s;
map <string, int> dic;
int n; void input_data()
{
dic["Tetrahedron"] = 4;
dic["Cube"] = 6;
dic["Octahedron"] = 8;
dic["Dodecahedron"] = 12;
dic["Icosahedron"] = 20;
rei(n);
} void o()
{
int ans = 0;
rep1(i, 1, n)
{
cin >> s;
ans += dic[s];
}
printf("%d\n", ans);
} int main()
{
//freopen("F:\\rush.txt", "r", stdin);
input_data();
o();
//printf("\n%.2lf sec \n", (double)clock() / CLOCKS_PER_SEC);
return 0;
}

【codeforces 785A】Anton and Polyhedrons的更多相关文章

  1. 【27.91%】【codeforces 734E】Anton and Tree

    time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  2. 【29.89%】【codeforces 734D】Anton and Chess

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  3. 【13.77%】【codeforces 734C】Anton and Making Potions

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  4. 【81.37%】【codeforces 734B】Anton and Digits

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  5. 【77.39%】【codeforces 734A】Anton and Danik

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  6. 【25.00%】【codeforces 584E】Anton and Ira

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  7. 【codeforces 508B】Anton and currency you all know

    [题目链接]:http://codeforces.com/contest/508/problem/B [题意] 给你一个奇数; 让你交换一次数字; 使得这个数字变成偶数; 要求偶数要最大; [题解] ...

  8. 【codeforces 785E】Anton and Permutation

    [题目链接]:http://codeforces.com/problemset/problem/785/E [题意] 给你一个初始序列1..n顺序 然后每次让你交换任意两个位置上面的数字; 让你实时输 ...

  9. 【codeforces 785D】Anton and School - 2

    [题目链接]:http://codeforces.com/contest/785/problem/D [题意] 给你一个长度为n的括号序列; 让你删掉若干个括号之后,整个序列变成前x个括号为左括号,后 ...

随机推荐

  1. Linux 从core信息中找到TLS信息

    背景 我们在查core问题时,有时候须要查看某个TLS变量的值.可是GDB没有提供直接的命令,或者我不知道.这篇文字的目的.就是想办法从core文件里找出某个线程存放TLS变量的内容. 依据 Linu ...

  2. [Angular] Update FormArray with patchValue

    Currently, patchValue doesn't support update FormArray. The workarround is you need to empty the for ...

  3. dataTable() 与 DataTable() 的差别与处理方式

    jQuery dataTable的初始化有两种方式: var dataTable = $('#example').dataTable(); 与 var DataTable = $('#example' ...

  4. Android 调用系统邮件,发送邮件到指定邮箱

    在项目中,最后有一个联络我们,要求是点击号码还有邮箱地址能够发送邮件,这时候解决的方案其实有两种,一种是调用系统发邮件的软件,可以添加邮箱账号就可以发送邮件:第二种是使用javamail来发送邮件.在 ...

  5. LA 3135 - Argus

    看题:传送门 大意就是让你编写一个称为argus的系统,这个系统支持一个register的命令: Register  Q_num Period 该命令注册了一个触发器,它每Period秒就会残生一个编 ...

  6. css3-12 transition+css或transform实现过渡动画

    css3-12 transition+css或transform实现过渡动画 一.总结 一句话总结:首先要设置hover后的效果,然后在transition里面指定执行哪些样式和执行时间为多长. 1. ...

  7. stm32的APB1和APB2时钟

    要学会看官方例子,还要查找官方程序...

  8. openGL线型和线宽以及线的抗锯齿

    openGL线型和线宽以及线抗锯齿 一. 线宽 Opengl的线宽设置:glLineWidth(width); width为float类型值,在0~10.0,大于10以上按10来处理. 若开启线的反走 ...

  9. html css div img垂直居中

    <head> <meta charset="UTF-8"> <meta name="Generator" content=&quo ...

  10. 洛谷 P2197 nim游戏

    洛谷 P2197 nim游戏 题目描述 甲,乙两个人玩Nim取石子游戏. nim游戏的规则是这样的:地上有n堆石子(每堆石子数量小于10000),每人每次可从任意一堆石子里取出任意多枚石子扔掉,可以取 ...