006. Distance

Codeforces
IDCF10269006
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Find the distance between two 2D points. Remember that the distance formula is $d = sqrt((x_2 -x_1)^2 + (y_2 -y_1)^2)$ _math.sqrt_ will calculate the square root of a number. Also, you also have to add the line _import math_ at the top of the program. The first two lines contain the X and Y coordinates of the first point respectively. The second two lines contain the X and Y coordinates of the second point respectively. Each coordinate will have an integer value between -1000 and 1000, inclusive. A double N representing the distance between the two points ## Input The first two lines contain the X and Y coordinates of the first point respectively. The second two lines contain the X and Y coordinates of the second point respectively. Each coordinate will have an integer value between -1000 and 1000, inclusive. ## Output A double N representing the distance between the two points [samples]
**Definitions** Let $ P_1 = (x_1, y_1) $ and $ P_2 = (x_2, y_2) $ be two points in $ \mathbb{R}^2 $. **Constraints** 1. $ x_1, y_1, x_2, y_2 \in \mathbb{Z} $ 2. $ -1000 \le x_1, y_1, x_2, y_2 \le 1000 $ **Objective** Compute the Euclidean distance: $$ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $$
API Response (JSON)
{
  "problem": {
    "name": "006. Distance",
    "description": {
      "content": "Find the distance between two 2D points. Remember that the distance formula is  $d = sqrt((x_2 -x_1)^2 + (y_2 -y_1)^2)$ _math.sqrt_ will calculate the square root of a number. Also, you also have to",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269006"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Find the distance between two 2D points. Remember that the distance formula is \n\n$d = sqrt((x_2 -x_1)^2 + (y_2 -y_1)^2)$\n\n_math.sqrt_ will calculate the square root of a number. Also, you also have to...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ P_1 = (x_1, y_1) $ and $ P_2 = (x_2, y_2) $ be two points in $ \\mathbb{R}^2 $.\n\n**Constraints**  \n1. $ x_1, y_1, x_2, y_2 \\in \\mathbb{Z} $  \n2. $ -1000 \\le x_1, y_1, x_2, y_2 \\...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments