J. MaratonIME goes to the japanese restaurant (again)

Codeforces
IDCF10098J
Time2000ms
Memory64MB
Difficulty
English · Original
Formal · Original
After a long day of hard training, MaratonIME (マラトニメ) members decided to go to a Japanese restaurant. Yeah, we love Japanese food. After a lot of sushi boats, when everyone was more than satisfied, they asked the sushi-man Sussushi (ススシ) for the last boat. Sussushi felt challenged and answered: – You want #cf_span(class=[tex-font-style-sc], body=[one more]) boat? You shall have one more boat... The sushi boat that he brought was the biggest that any contestant had ever seen. Some contestants even dare saying that was the biggest sushi boat that ever existed, exceeding the previous limit of 105 sushis made by the suhiwoman Gioza (ジョザ) in 742, in a festival for the king that year, Carlos-sama (カーロス様). Besides that the contestants accepted the challenge, and together they managed to eat all the sushis. After that, the contestants we're so full that they couldn't touch each other. They couldn't even think about programming problems. Help them find what pair of friends are touching themselves, so they can move away from each other. The contestant are represented as circles in plane, and two contestants touch each other if the circles touch each other. It's guaranteed that the intersection area of any two circles is null. In the first line there is a single integer, n indicating the number of contestants (2 ≤ n ≤ 1000). Each one of the next n lines has 3 integers xi, yi e ri, the (i + 1)-th line describes the ith contestant. (xi, yi) are the coordinates of the center of the circle, and ri is the radius. ( - 104 ≤ xi, yi ≤ 104, 1 ≤ ri ≤ 2·104) It is guaranteed that the intersection area of any two circles is null. For each pair of circles that touch each other, print in one line the indexes of these circles. The collisions can be printed in any order, the indexes of both circles can also be printed in any order. Don't print the collisions more than once, that means, if i intersects with j, print i j or j i, but not both. ## Input In the first line there is a single integer, n indicating the number of contestants (2 ≤ n ≤ 1000).Each one of the next n lines has 3 integers xi, yi e ri, the (i + 1)-th line describes the ith contestant. (xi, yi) are the coordinates of the center of the circle, and ri is the radius. ( - 104 ≤ xi, yi ≤ 104, 1 ≤ ri ≤ 2·104)It is guaranteed that the intersection area of any two circles is null. ## Output For each pair of circles that touch each other, print in one line the indexes of these circles. The collisions can be printed in any order, the indexes of both circles can also be printed in any order.Don't print the collisions more than once, that means, if i intersects with j, print i j or j i, but not both. [samples]
**Definitions** Let $ N \in \mathbb{Z} $, $ 0 \leq N \leq 100 $, be the number of objects in the project. Let $ O = \{o_0, o_1, \dots, o_N\} $ be the set of objects, where $ o_0 $ is the root "project" item. For each object $ o_i $: - Let $ s_i \in \{ '+', '-' \} $ denote its state: - $ s_i = '-' $ means expanded, - $ s_i = '+' $ means collapsed. - Let $ K_i \in \mathbb{Z}_{\geq 0} $ be the number of direct children of $ o_i $. - Let $ A_i = (a_{i,1}, a_{i,2}, \dots, a_{i,K_i}) $ be the ordered list of child object indices (each $ a_{i,j} \in \{1, \dots, N\} $, distinct). **Constraints** 1. $ 0 \leq N \leq 100 $ 2. For each $ i \in \{0, 1, \dots, N\} $: - $ s_i \in \{ '+', '-' \} $ - $ K_i \geq 0 $ - $ A_i $ contains $ K_i $ distinct integers from $ \{1, \dots, N\} $ - If $ K_i = 0 $, then $ s_i = '-' $ (by definition) **Objective** Output the hierarchical representation of the project tree, where: - Each object $ o_i $ is printed on its own line. - The indentation level of $ o_i $ equals its depth in the tree (root $ o_0 $ at depth 0). - For each object at depth $ d $: - The first character of the line is the state symbol $ s_i $. - This is followed by $ d $ spaces (not tabs), each representing the nesting level. - The object’s index $ i $ is not printed; only the state symbol and indentation matter. - If an object is collapsed ($ s_i = '+' $), its children are **not** rendered. - If an object is expanded ($ s_i = '-' $), its children are rendered immediately after, in order, at depth $ d+1 $. - The output must reflect the tree structure via indentation and state symbols, respecting the given nesting hierarchy and expansion states.
API Response (JSON)
{
  "problem": {
    "name": "J. MaratonIME goes to the japanese restaurant (again)",
    "description": {
      "content": "After a long day of hard training, MaratonIME (マラトニメ) members decided to go to a Japanese restaurant. Yeah, we love Japanese food. After a lot of sushi boats, when everyone was more than satisfied, t",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10098J"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "After a long day of hard training, MaratonIME (マラトニメ) members decided to go to a Japanese restaurant. Yeah, we love Japanese food.\n\nAfter a lot of sushi boats, when everyone was more than satisfied, t...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N \\in \\mathbb{Z} $, $ 0 \\leq N \\leq 100 $, be the number of objects in the project.  \nLet $ O = \\{o_0, o_1, \\dots, o_N\\} $ be the set of objects, where $ o_0 $ is the root \"pro...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments