POJ1118
来源:互联网 发布:阿里云服务器公网ip 编辑:程序博客网 时间:2024/05/21 17:46
从给定case中找出一条直线使上面的点数最多
很久以前的代码了
#include "stdio.h"int pt[701][2];int main(void){unsigned Pnum;unsigned NumOfLine;int Fx,Fy,left;while(((scanf("%d",&Pnum)) ==1) && Pnum){unsigned N = 0;for( size_t ix = 0 ; ix != Pnum ; ix ++ ){scanf("%d %d",pt[ix] + 0,pt[ix] + 1);}for( size_t ix = 0 ; ix != Pnum - 1 ; ix ++ ){for( size_t id = ix + 1 ; id != Pnum ; id ++ ){NumOfLine = 0;Fx = (pt[ix][0] - pt[id][0]);Fy = (pt[ix][1] - pt[id][1]); left = Fx*pt[id][1] - Fy*pt[id][0];for( size_t i = id + 1 ; i != Pnum ; i ++ ){if( left == (Fx*pt[i][1] - Fy*pt[i][0]) ){NumOfLine ++;}}N = N < NumOfLine ? NumOfLine : N; }}printf("%d\n",N + 2);}return 0;}
- poj1118
- poj1118
- POJ1118
- poj1118
- poj1118
- poj1118
- poj1118(水题)
- poj1118解题报告
- poj1118(Lining Up)
- POJ1118解题报告
- POJ1118 Lining up
- POJ1118解题报告
- POJ1118 解题报告JAVA
- POJ1118 HDU1432 Lining Up
- POJ1118 Lining Up 计算几何
- 【POJ】:POJ2606,poj1118,poj2780合集
- POJ1118,Lining Up,暴力过的,hash什么的只能仰慕
- 最多几个点在一条直线上(poj1118 poj2606 poj2780)
- POJ1061
- POJ1077八数码问题哈希,bfs
- linux调度器(四)——主调度器与CFS
- 新东方六级12-12
- linux调度器(五)——进程管理与CFS
- POJ1118
- Ubuntu下使用valgrind检测内存泄露流程
- linux调度器(六)——应用层理解CFS及组调度
- 桥接模式(Bridge)
- POJ1207
- 舵机知识扫盲
- POJ 1386 (欧拉路径+并查集)
- 九度 题目1093:WERTYU
- POJ1222