A10160 | BCPC
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
In the first line of the input three integers $n$ , $c$ and $d$ ( $3<=n<=345678,1<=c,d<=10^{9}$ ) are written. They denote the number of students Blenda can use to form teams, the value subtracted from all reading speeds and the value subtracted from all writing speeds respectively.
Each of the next $n$ lines contains two integers $r_{i}$ and $w_{i}$ ( $0<r_{i},w_{i}<=10^{9},|r_{i}-c|+|w_{i}-d|>0$ ). There are no two students, such that both their reading and writing speeds coincide, i.e. for every $i≠j$ condition $|r_{i}-r_{j}|+|w_{i}-w_{j}|>0$ holds.
Each of the next $n$ lines contains two integers $r_{i}$ and $w_{i}$ ( $0<r_{i},w_{i}<=10^{9},|r_{i}-c|+|w_{i}-d|>0$ ). There are no two students, such that both their reading and writing speeds coincide, i.e. for every $i≠j$ condition $|r_{i}-r_{j}|+|w_{i}-w_{j}|>0$ holds.
输入格式
Print the number of different teams in BSU, that are good according to Blenda's definition.
输出格式
In the first sample the following teams are good: $(i=1,j=2,k=3)$ , $(i=2,j=5,k=1)$ , $(i=1,j=4,k=3)$ , $(i=5,j=1,k=4)$ .
Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .
Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .
输入输出样例
输入 #1
5 2 2 1 1 4 1 2 3 3 2 3 4
输出 #1
4
输入 #2
7 6 6 3 2 1 7 5 7 3 7 6 4 8 9 8 5
输出 #2
11
In the first sample the following teams are good: $(i=1,j=2,k=3)$ , $(i=2,j=5,k=1)$ , $(i=1,j=4,k=3)$ , $(i=5,j=1,k=4)$ .
Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .
Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted