QOJ.ac

QOJ

実行時間制限: 1.5 s メモリ制限: 256 MB 満点: 100

#1452. 不够长

統計

Alice 有 $n$ 个二维向量,但 Bob 认为这些向量不够长。 Alice 想要找到这些向量的一个子集,使得它们的和尽可能长。

第一行包含一个整数 $n$。接下来的 $n$ 行,每行包含两个整数 $x_i$ 和 $y_i$,表示第 $i$ 个向量的坐标。

$1 \le n \le 2 \cdot 10^5$ $-10^4 \le x_i, y_i \le 10^4$

输出一个整数——可以构成的最长向量的平方长度。

样例

输入格式 1

4
1 0
0 1
1 1
-1 -1

输出格式 1

8

说明

在样例中,前 3 个向量的和为 $(2, 2)$,其平方长度为 $8$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.