QOJ.ac

QOJ

Time Limit: 1.5 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#12651. 圆

Statistics

平面上有 $N$ 个圆。第 $i$ 个圆的圆心为 $(x_i, y_i)$,半径为 $\sqrt{x_i^2 + y_i^2}$。

计算位于至少一个圆内的格点(坐标为整数的点)的数量。注意,边界也被视为在圆内。

输入格式

输入格式如下:

$N$ $x_1 \ y_1$ $x_2 \ y_2$ $\vdots$ $x_N \ y_N$

数据范围

  • $1 \le N \le 10^5$
  • $-10^5 \le x_i, y_i \le 10^5$
  • $(x_i, y_i)$ 两两不同。
  • $(x_i, y_i) \neq (0, 0)$
  • 输入中的所有值均为整数。

输出格式

在一行中输出答案。

样例

输入格式 1

2
0 1
0 -1

输出格式 1

9

说明

输入格式 2

2
3 1
1 4

输出格式 2

74

说明

输入格式 3

4
3 4
4 3
-2 -2
-3 2

输出格式 3

146

说明

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.