A - Anton and Polyhedrons

题目连接:

http://codeforces.com/contest/785/problem/A

Description

Anton's favourite geometric figures are regular polyhedrons. Note that there are five kinds of regular polyhedrons:

Tetrahedron. Tetrahedron has 4 triangular faces.

Cube. Cube has 6 square faces.

Octahedron. Octahedron has 8 triangular faces.

Dodecahedron. Dodecahedron has 12 pentagonal faces.

Icosahedron. Icosahedron has 20 triangular faces.

All five kinds of polyhedrons are shown on the picture below:

Anton has a collection of n polyhedrons. One day he decided to know, how many faces his polyhedrons have in total. Help Anton and find this number!

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 200 000) — the number of polyhedrons in Anton's collection.

Each of the following n lines of the input contains a string si — the name of the i-th polyhedron in Anton's collection. The string can look like this:

"Tetrahedron" (without quotes), if the i-th polyhedron in Anton's collection is a tetrahedron.

"Cube" (without quotes), if the i-th polyhedron in Anton's collection is a cube.

"Octahedron" (without quotes), if the i-th polyhedron in Anton's collection is an octahedron.

"Dodecahedron" (without quotes), if the i-th polyhedron in Anton's collection is a dodecahedron.

"Icosahedron" (without quotes), if the i-th polyhedron in Anton's collection is an icosahedron.

Output

Output one number — the total number of faces in all the polyhedrons in Anton's collection.

Sample Input

4

Icosahedron

Cube

Tetrahedron

Dodecahedron

Sample Output

42

Hint

题意

给你一堆多面体,然后问你总共多少个面。

题解:

实际上只需要if if if if就好了嘛

代码

#include<bits/stdc++.h>
using namespace std;
int n,ans=0;
string s;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>s;
if(s=="Tetrahedron")ans+=4;
if(s=="Cube")ans+=6;
if(s=="Octahedron")ans+=8;
if(s=="Dodecahedron")ans+=12;
if(s=="Icosahedron")ans+=20;
}
cout<<ans<<endl;
}

Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题的更多相关文章

  1. Codeforces Round #404 (Div. 2) B. Anton and Classes 水题

    B. Anton and Classes 题目连接: http://codeforces.com/contest/785/problem/B Description Anton likes to pl ...

  2. Codeforces Round #379 (Div. 2) D. Anton and Chess 水题

    D. Anton and Chess 题目连接: http://codeforces.com/contest/734/problem/D Description Anton likes to play ...

  3. Codeforces Round #379 (Div. 2) B. Anton and Digits 水题

    B. Anton and Digits 题目连接: http://codeforces.com/contest/734/problem/B Description Recently Anton fou ...

  4. Codeforces Round #379 (Div. 2) A. Anton and Danik 水题

    A. Anton and Danik 题目连接: http://codeforces.com/contest/734/problem/A Description Anton likes to play ...

  5. Codeforces Round #297 (Div. 2)A. Vitaliy and Pie 水题

    Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  ...

  6. Codeforces Round #290 (Div. 2) A. Fox And Snake 水题

    A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to le ...

  7. Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题

    A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...

  8. Codeforces Round #373 (Div. 2) B. Anatoly and Cockroaches 水题

    B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly liv ...

  9. Codeforces Round #368 (Div. 2) A. Brain's Photos 水题

    A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very ...

随机推荐

  1. shell 判断脚本参数

    测试登陆脚本 ./test.sh -p 123 -P 3306 -h 127.0.0.1 -u root #!/bin/sh ];then echo "USAGE: $0 -u user - ...

  2. 第12月第29天 cocos quick manual

    1. Example: $ cd cocos2d-x $ ./setup.py $ source FILE_TO_SAVE_SYSTEM_VARIABLE $ cocos new MyGame -p ...

  3. linux命令中which、whereis、locate有什么区别?

    1.find find是最常用和最强大的查找命令.它能做到实时查找,精确查找,但速度慢. find的使用格式如下: #find [指定目录] [指定条件] [指定动作] 指定目录:是指所要搜索的目录和 ...

  4. pytorch函数之torch.normal()

    Returns a Tensor of random numbers drawn from separate normal distributions who’s mean and standard ...

  5. python模块分析之hashlib加密(二)

    前言 hashlib模块是py3.+用来对字符串进行hash加密的模块,核心算法是md5,明文与密文是一一对应不变的关系:用于注册.登录时用户名.密码等加密使用. 模块分析 hashlib模块有多种加 ...

  6. 浅谈tomcat中间件的优化【转】

    今天来总结一下tomcat的一些优化的方案,由于本人才疏学浅,写的不好,勿喷! tomcat对于大多数从事开发工作的童鞋应该不会很陌生,通常做为默认的开发环境来为大家服务,不过tomcat默认的一些配 ...

  7. springboot创建一个可执行的jar

    让我们通过创建一个完全自包含的可执行jar文件来结束我们的示例,该jar文件可以在生产环境运行.可执行jars(有时候被成为胖jars "fat jars")是包含你的编译后的类和 ...

  8. React-Native 之 ScrollView介绍和使用

    前言 学习本系列内容需要具备一定 HTML 开发基础,没有基础的朋友可以先转至 HTML快速入门(一) 学习 本人接触 React Native 时间并不是特别长,所以对其中的内容和性质了解可能会有所 ...

  9. python 列表元组加减乘除法

    元组(typle)列表(list)没有减法和除法,但有加法和乘法. 1.加法,即把元素相加.只可以list和tuple相加,不能加其他类型. t= (1, ) + (2, 3, 4) print(t, ...

  10. 中文分词-jieba

    支持三种分词模式: 精确模式,试图将句子最精确地切开,适合文本分析: 全模式,把句子中所有的可以成词的词语都扫描出来, 速度非常快,但是不能解决歧义: 搜索引擎模式,在精确模式的基础上,对长词再次切分 ...