046. Binary Math

Codeforces
IDCF10269046
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Given two strings that represent binary numbers, return the sum of the 2 numbers in binary. The first line will contain the first binary number and the second line will contain the second binary number. Print the sum of the two numbers in binary. If you need help understanding how to read numbers in binary, you can check out the following link: https://medium.com/@LindaVivah/learn-how-to-read-binary-in-5-minutes-dac1feb991e ## Input The first line will contain the first binary number and the second line will contain the second binary number. ## Output Print the sum of the two numbers in binary. [samples] ## Note If you need help understanding how to read numbers in binary, you can check out the following link: https://medium.com/@LindaVivah/learn-how-to-read-binary-in-5-minutes-dac1feb991e
**Definitions** Let $ a, b \in \{0,1\}^* $ be two binary strings representing non-negative integers in base 2. **Objective** Compute the binary representation of the integer sum $ a + b $, where $ a $ and $ b $ are interpreted as base-2 numerals. **Output** Print the binary string representing $ \text{bin}( \text{int}(a, 2) + \text{int}(b, 2) ) $.
API Response (JSON)
{
  "problem": {
    "name": "046. Binary Math",
    "description": {
      "content": "Given two strings that represent binary numbers, return the sum of the 2 numbers in binary. The first line will contain the first binary number and the second line will contain the second binary numb",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269046"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given two strings that represent binary numbers, return the sum of the 2 numbers in binary.\n\nThe first line will contain the first binary number and the second line will contain the second binary numb...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ a, b \\in \\{0,1\\}^* $ be two binary strings representing non-negative integers in base 2.\n\n**Objective**  \nCompute the binary representation of the integer sum $ a + b $, where ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments