164. Cashier

Codeforces
IDCF10269164
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You are working as a cashier for a supermarket, and items are handed to you to be scanned one by one by the customer. You do not know how many items they have, but after the last item is scanned, the customers usually say, "done". A series of row separated floats representing prices, with the word "done" succeeding the last item of the customer's cart. Print out the total price of all the items. ## Input A series of row separated floats representing prices, with the word "done" succeeding the last item of the customer's cart. ## Output Print out the total price of all the items. [samples]
**Definitions** Let $ P = (p_1, p_2, \dots, p_n) $ be a finite sequence of positive real numbers representing item prices, where $ n \geq 1 $. Let the input be a sequence of lines, each containing either a float $ p_i \in \mathbb{R}^+ $ or the string "done", with "done" appearing exactly once and immediately after $ p_n $. **Constraints** - Each $ p_i > 0 $ - The sequence ends precisely with the string "done" after $ p_n $ **Objective** Compute the total price: $$ S = \sum_{i=1}^{n} p_i $$
API Response (JSON)
{
  "problem": {
    "name": "164. Cashier",
    "description": {
      "content": "You are working as a cashier for a supermarket, and items are handed to you to be scanned one by one by the customer. You do not know how many items they have, but after the last item is scanned, the ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269164"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are working as a cashier for a supermarket, and items are handed to you to be scanned one by one by the customer. You do not know how many items they have, but after the last item is scanned, the ...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ P = (p_1, p_2, \\dots, p_n) $ be a finite sequence of positive real numbers representing item prices, where $ n \\geq 1 $.  \nLet the input be a sequence of lines, each containing...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments