E. Cheese Board

Codeforces
IDCF952E
Time1000ms
Memory256MB
Difficulty
English · Original
Chinese · Translation
Formal · Original
_Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard)._ <center>![image](https://espresso.codeforces.com/8cb6bb6a9188b4785e6638112e3faf08e268e667.png)</center> ## Input The first line of input contains a single integer _N_ (1 ≤ _N_ ≤ 100) — the number of cheeses you have. The next _N_ lines describe the cheeses you have. Each line contains two space-separated strings: the name of the cheese and its type. The name is a string of lowercase English letters between 1 and 10 characters long. The type is either "_soft_" or "_hard_. All cheese names are distinct. ## Output Output a single number. [samples]
_不要与棋盘混淆。_ 输入的第一行包含一个整数 #cf_span[N] (#cf_span[1 ≤ N ≤ 100]) —— 你拥有的奶酪数量。 接下来的 #cf_span[N] 行描述了你拥有的奶酪。每行包含两个用空格分隔的字符串:奶酪的名称及其类型。名称是由 1 到 10 个小写英文字母组成的字符串。类型为 "_soft_" 或 "_hard_"。所有奶酪名称互不相同。 请输出一个数字。 ## Input 输入的第一行包含一个整数 #cf_span[N] (#cf_span[1 ≤ N ≤ 100]) —— 你拥有的奶酪数量。接下来的 #cf_span[N] 行描述了你拥有的奶酪。每行包含两个用空格分隔的字符串:奶酪的名称及其类型。名称是由 1 到 10 个小写英文字母组成的字符串。类型为 "_soft_" 或 "_hard_"。所有奶酪名称互不相同。 ## Output 请输出一个数字。 [samples]
**Definitions** Let $ N \in \mathbb{Z} $ be the number of cheeses, with $ 1 \leq N \leq 100 $. Let $ C = \{ (name_i, type_i) \mid i \in \{1, \dots, N\} \} $ be the set of cheeses, where: - $ name_i \in \Sigma^{1..10} $, $ \Sigma = \{a, b, \dots, z\} $, - $ type_i \in \{ \text{"soft"}, \text{"hard"} \} $, - All $ name_i $ are distinct. **Objective** Count the number of cheeses of type "hard". $$ \text{Output} = \left| \left\{ i \in \{1, \dots, N\} \mid type_i = \text{"hard"} \right\} \right| $$
Samples
Input #1
9
brie soft
camembert soft
feta soft
goat soft
muenster soft
asiago hard
cheddar hard
gouda hard
swiss hard
Output #1
3
Input #2
6
parmesan hard
emmental hard
edam hard
colby hard
gruyere hard
asiago hard
Output #2
4
API Response (JSON)
{
  "problem": {
    "name": "E. Cheese Board",
    "description": {
      "content": "_Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard)._ <center>![image](https://espresso.codeforces.com/8cb6bb6a9188b4785e6638112e3faf08e268e667.png)</center>",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF952E"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "_Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard)._\n\n<center>![image](https://espresso.codeforces.com/8cb6bb6a9188b4785e6638112e3faf08e268e667.png)</center>\n\n## Input\n\nTh...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "_不要与棋盘混淆。_\n\n输入的第一行包含一个整数 #cf_span[N] (#cf_span[1 ≤ N ≤ 100]) —— 你拥有的奶酪数量。\n\n接下来的 #cf_span[N] 行描述了你拥有的奶酪。每行包含两个用空格分隔的字符串:奶酪的名称及其类型。名称是由 1 到 10 个小写英文字母组成的字符串。类型为 \"_soft_\" 或 \"_hard_\"。所有奶酪名称互不相同。\n\n请输出一个数字。...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N \\in \\mathbb{Z} $ be the number of cheeses, with $ 1 \\leq N \\leq 100 $.  \nLet $ C = \\{ (name_i, type_i) \\mid i \\in \\{1, \\dots, N\\} \\} $ be the set of cheeses, where:  \n- $ nam...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments