CF785A.Anton and Polyhedrons

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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!

安东最喜爱的几何图形是正多面体。注意,正多面体共有五种:

  • 正四面体:有 4 个三角形面;
  • 立方体(正六面体):有 6 个正方形面;
  • 正八面体:有 8 个三角形面;
  • 正十二面体:有 12 个五边形面;
  • 正二十面体:有 20 个三角形面。

这五种正多面体如下图所示:

安东收藏了 nn 个正多面体。某天他想知道自己收藏的所有多面体一共有多少个面。请帮助安东计算这个总数!

输入格式

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 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.

输入的第一行包含一个整数 nn(1≤n≤200 0001 \leq n \leq 200\,000)——表示安东收藏的多面体数量。

接下来的 nn 行,每行包含一个字符串 sis_i —— 表示安东收藏中第 ii 个多面体的名称。该字符串可能为以下之一:

  • “Tetrahedron”(不带引号),如果安东收藏中第 ii 个多面体是正四面体;
  • “Cube”(不带引号),如果安东收藏中第 ii 个多面体是立方体;
  • “Octahedron”(不带引号),如果安东收藏中第 ii 个多面体是正八面体;
  • “Dodecahedron”(不带引号),如果安东收藏中第 ii 个多面体是正十二面体;
  • “Icosahedron”(不带引号),如果安东收藏中第 ii 个多面体是正二十面体。

输出格式

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.

在第一个样例中,安东有一个正二十面体、一个立方体、一个正四面体和一个正十二面体。正二十面体有 20 个面,立方体有 6 个面,正四面体有 4 个面,正十二面体有 12 个面。总共,它们有 20 + 6 + 4 + 12 = 4220 + 6 + 4 + 12 = 42 个面。

输入解题思路,AI测评打分。不知道怎么写?

首页