RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
USACO0506

Multiple Choice Test

Diamond IV 다이아몬드 IV
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

The cows are taking a multiple choice test. But instead of a standard test where your
selected choices are scored for each question individually and then summed, in
this test your selected choices are summed before being scored.

Specifically, you are given \(N\) (\(2\le N\le 10^5\)) groups of integer vectors on
the 2D plane, where each vector is denoted by an ordered pair \((x,y)\). Choose
one vector from each group such that the sum of the vectors is as far away from
the origin as possible.

It is guaranteed that the total number of vectors is at most \(2\cdot 10^5\).
Each group has size at least \(2\), and within a group, all vectors are distinct.
It is also guaranteed that every \(x\) and \(y\) coordinate has absolute value at
most \(\frac{10^9}{N}\).

Problem credits: Benjamin Qi

제약

SCORING

  • In test cases 1-5, the total number of vectors is at most \(10^3\).
  • In test cases 6-9, every group has size exactly two.
  • Test cases 10-17 satisfy no additional constraints.

Problem credits: Benjamin Qi

입력 형식

The first line contains \(N\), the number of groups.

Each group starts with \(G\), the number of vectors in the group, followed by \(G\)
lines containing the vectors in that group. Consecutive groups are separated by
newlines.

출력 형식

The maximum possible squared Euclidean distance.

예제 1
입력
3

2
-2 0
1 0

2
0 -2
0 1

3
-5 -5
5 1
10 10
출력
242
설명

It is optimal to select \((1,0)\) from the first group, \((0,1)\) from the second
group, and \((10,10)\) from the third group. The sum of these vectors is
\((11,11)\), which is squared distance \(11^2+11^2=242\) from the origin.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2021-2022 > January > Platinum

태그

평가 및 의견

Multiple Choice Test

개요
출제자 난이도 Diamond IV 다이아몬드 IV 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Multiple Choice Test

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8