A1035 | Lots of Triangles--Platinum
来源USACO
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Farmer John is thinking of selling some of his land to earn a bit of extra
income. His property contains $n$ trees ($3 \leq N \leq 300$), each described
by a point in the 2D plane, no three of which are collinear. FJ is thinking
about selling triangular lots of land defined by having trees at their
vertices; there are of course $L = \binom{N}{3}$ such lots he can consider,
based on all possible triples of trees on his property.
A triangular lot has value $v$ if it contains exactly $v$ trees in its
interior (the trees on the corners do not count, and note that there are no
trees on the boundaries since no three trees are collinear). For every $v = 0
\ldots N-3$, please help FJ determine how many of his $L$ potential lots have
value $v$.
income. His property contains $n$ trees ($3 \leq N \leq 300$), each described
by a point in the 2D plane, no three of which are collinear. FJ is thinking
about selling triangular lots of land defined by having trees at their
vertices; there are of course $L = \binom{N}{3}$ such lots he can consider,
based on all possible triples of trees on his property.
A triangular lot has value $v$ if it contains exactly $v$ trees in its
interior (the trees on the corners do not count, and note that there are no
trees on the boundaries since no three trees are collinear). For every $v = 0
\ldots N-3$, please help FJ determine how many of his $L$ potential lots have
value $v$.
输入格式
The first line of input contains $N$.
The following $N$ lines contain the $x$ and $y$ coordinates of a single tree;
these are both integers in the range $0 \ldots 1,000,000$.
The following $N$ lines contain the $x$ and $y$ coordinates of a single tree;
these are both integers in the range $0 \ldots 1,000,000$.
输出格式
Output $N-2$ lines, where output line $i$ contains a count of the number of
lots having value $i-1$.
lots having value $i-1$.
输入输出样例
输入 #1
7 3 6 17 15 13 15 6 12 9 1 2 7 10 19
输出 #1
28 6 1 0 0
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted