A1128 | [COCI-2007_2008-contest5]#4 JABUKE
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Ante bought a piece of land. The land contains N apple trees, but his piece is triangular and it is not easy for him to determine which apple trees belong to him.
Your program will be given the coordinates of the vertices of the triangle forming Ante's piece, and the coordinates of all apple trees. Determine the area of land belonging to Ante, and the number of trees belonging to him. We consider apple trees on the very border of his piece to belong to him.
The area of a triangle with vertices (xA, yA), (xB, yB) and (xC, yC) is given by the following formula:
2 ( ) ( ) ( ) A B C B C A C A B x y − y + x y − y + x y −
Your program will be given the coordinates of the vertices of the triangle forming Ante's piece, and the coordinates of all apple trees. Determine the area of land belonging to Ante, and the number of trees belonging to him. We consider apple trees on the very border of his piece to belong to him.
The area of a triangle with vertices (xA, yA), (xB, yB) and (xC, yC) is given by the following formula:
2 ( ) ( ) ( ) A B C B C A C A B x y − y + x y − y + x y −
输入格式
The first three lines contain the coordinates of the vertices of the triangle.
The following line contains the integer N (1 ≤ N ≤ 100), the number of apple trees.
Each of the following N lines contains the coordinates of one apple tree.
All coordinates are pairs of positive integers less than 1000, separated by a space.
The following line contains the integer N (1 ≤ N ≤ 100), the number of apple trees.
Each of the following N lines contains the coordinates of one apple tree.
All coordinates are pairs of positive integers less than 1000, separated by a space.
输出格式
Output the area of land belonging to Ante on the first line, with one digit after the decimal point.
Output the number of tree belonging to Ante on the second line.
Output the number of tree belonging to Ante on the second line.
输入输出样例
输入 #1
1 1 5 1 3 3 4 3 1 3 2 3 3 3 4
输出 #1
4.0 3
输入 #2
3 2 5 4 1 6 3 2 4 3 5 4 3
输出 #2
6.0 3
输入 #3
2 6 5 1 7 8 5 1 4 3 5 6 4 6 5 4 7
输出 #3
15.5 2
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted