A10961 | Anton and Polyhedrons
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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!
- 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!
输入格式
The first line of the input contains a single integer $n$ $(1<=n<=200000)$ — the number of polyhedrons in Anton's collection.
Each of the following $n$ lines of the input contains a string $s_{i}$ — 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.
Each of the following $n$ lines of the input contains a string $s_{i}$ — 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 one number — the total number of faces in all the polyhedrons in Anton's collection.
输入输出样例
输入 #1
4 Icosahedron Cube Tetrahedron Dodecahedron
输出 #1
42
输入 #2
3 Dodecahedron Octahedron Octahedron
输出 #2
28
In the first sample Anton has one icosahedron, one cube, one tetrahedron and one dodecahedron. Icosahedron has $20$ faces, cube has $6$ faces, tetrahedron has $4$ faces and dodecahedron has $12$ faces. In total, they have $20+6+4+12=42$ faces.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted