[POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn

Luogu
IDLGP9405
Time2000ms
Memory256MB
DifficultyP7
数学2020POI(波兰)Special Judge微积分其它技巧
二维平面上有 $n$ 个点。 对于每个点,算出它到其他所有点的欧氏距离之和。 相对误差不超过 $0.1\%$ 即可。 ## Input 第一行一个整数 $n$。 接下来 $n$ 行,每行两个整数 $x,y$,表示一个点的坐标。 ## Output $n$ 行,每行一个实数,表示每个点的答案。 [samples] ## Background 译自 [XXVIII Olimpiada Informatyczna - III etap](https://sio2.mimuw.edu.pl/c/oi28-3/dashboard/) [Komunikacja międzyplanetarn](https://szkopul.edu.pl/problemset/problem/43LcdhShos7i99wnVNtQYUUK/statement/)。 d2t1。 ## Note 对于所有数据,$2\leq n\leq 100000$,$-10^6\leq x,y\leq 10^6$。 | 子任务编号 | 附加限制 | 分数 | | :----------: | :----------: | :----------: | | 1 | $n\leq 1000$ | 4 | | 2 | 所有点共线 | 16 | | 3 | 点的坐标随机,相对误差不超过 $2\%$ 即可 | 20 | | 4 | | 60 |
Samples
Input #1
4
-1 0
0 0
3 3
-1 1
Output #1
7.000000000000
6.656854249492
13.714776642119
6.886349517373
Input #2
25
-2 -2
-2 -1
-2 0
-2 1
-2 2
-1 -2
-1 -1
-1 0
-1 1
-1 2
0 -2
0 -1
0 0
0 1
0 2
1 -2
1 -1
1 0
1 1
1 2
2 -2
2 -1
2 0
2 1
2 2
Output #2
79.340412611230
68.023981606779
64.155694316737
68.023981606779
79.340412611230
68.023981606779
55.532407162959
51.265774235248
55.532407162959
68.023981606779
64.155694316737
51.265774235248
46.859106568475
51.265774235248
64.155694316737
68.023981606779
55.532407162958
51.265774235248
55.532407162959
68.023981606779
79.340412611230
68.023981606779
64.155694316737
68.023981606779
79.340412611230
Input #3
见附件
Output #3
见附件
API Response (JSON)
{
  "problem": {
    "name": "[POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn",
    "description": {
      "content": "二维平面上有 $n$ 个点。 对于每个点,算出它到其他所有点的欧氏距离之和。 相对误差不超过 $0.1\\%$ 即可。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": {
      "LuoguStyle": "P7"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9405"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "二维平面上有 $n$ 个点。\n\n对于每个点,算出它到其他所有点的欧氏距离之和。\n\n相对误差不超过 $0.1\\%$ 即可。\n\n## Input\n\n第一行一个整数 $n$。\n\n接下来 $n$ 行,每行两个整数 $x,y$,表示一个点的坐标。\n\n## Output\n\n$n$ 行,每行一个实数,表示每个点的答案。\n\n[samples]\n\n## Background\n\n译自 [XXVIII Olimpiad...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments