066. Neural Network Weight Count

Codeforces
IDCF10269066
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
As computers have become more and more powerful, the use of artificial intelligence has become ever more prominent in modern computing. As a result, a mechanism called a neural network has become a very commonly used tool for replicating the basic biological processes that result in the function of the brain. Neural Networks are composed of a series of "layers" of nodes, where each node of layer $i$ will connect with every node of layer $i + 1$. The first line contains a single integer $N$ that represents the number of layers. The next line contains $N$ space-separated integers that represent the number of nodes in each layer respectively. A single integer that represents the total number of weights in the network. ## Input The first line contains a single integer $N$ that represents the number of layers. The next line contains $N$ space-separated integers that represent the number of nodes in each layer respectively. ## Output A single integer that represents the total number of weights in the network. [samples]
**Definitions** Let $ N \in \mathbb{Z}^+ $ be the number of layers. Let $ n_i \in \mathbb{Z}^+ $ denote the number of nodes in layer $ i $, for $ i \in \{1, 2, \dots, N\} $. **Constraints** $ N \geq 1 $, and $ n_i \geq 1 $ for all $ i \in \{1, \dots, N\} $. **Objective** Compute the total number of weights in the neural network: $$ \sum_{i=1}^{N-1} n_i \cdot n_{i+1} $$
API Response (JSON)
{
  "problem": {
    "name": "066. Neural Network Weight Count",
    "description": {
      "content": "As computers have become more and more powerful, the use of artificial intelligence has become ever more prominent in modern computing. As a result, a mechanism called a neural network has become a ve",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269066"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "As computers have become more and more powerful, the use of artificial intelligence has become ever more prominent in modern computing. As a result, a mechanism called a neural network has become a ve...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of layers.  \nLet $ n_i \\in \\mathbb{Z}^+ $ denote the number of nodes in layer $ i $, for $ i \\in \\{1, 2, \\dots, N\\} $.\n\n**Constraints**  \n$ N...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments