博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UVA270-Lining Up
阅读量:5097 次
发布时间:2019-06-13

本文共 2411 字,大约阅读时间需要 8 分钟。

斜率斜率斜率.........

#include
#include
#include
#include
#include
#include
#include
using namespace std;struct node{ int x,y; node(){} node(int a,int b){x=a;y=b;}};int main(){ // freopen("in","r",stdin); vector
box; map
dir; string s; int T,i,j,k,n,x,y,ans,t; cin>>T; getchar(); getchar(); for(i=0;i
Time Limit:3000MS   Memory Limit:Unknown   64bit IO Format:%lld & %llu

Description

  

``How am I ever going to solve this problem?

" said the pilot.

Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangerous area. Furthermore, the pilot could only fly over the area once in a straight line, and she had to fly over as many points as possible. All points were given by means of integer coordinates in a two-dimensional space. The pilot wanted to know the largest number of points from the given set that all lie on one line. Can you write a program that calculates this number?

Your program has to be efficient!

The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.

The input consists of N pairs of integers, where 1 < N < 700. Each pair of integers is separated by one blank and ended by a new-line character. The list of pairs is ended with an end-of-file character. No pair will occur twice.

For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line.

The output consists of one integer representing the largest number of points that all lie on one line.

11 12 23 39 1010 11

3

Source

Root :: Competitive Programming: Increasing the Lower Bound of Programming Contests (Steven & Felix Halim) :: Chapter 7. (Computational) Geometry :: Geometry Basics ::
Root :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) ::
Root :: Competitive Programming 3: The New Lower Bound of Programming Contests (Steven & Felix Halim) :: More Advanced Topics :: Problem Decomposition ::
Root :: Competitive Programming 2: This increases the lower bound of Programming Contests. Again (Steven & Felix Halim) :: (Computational) Geometry :: Basic Geometry ::

转载于:https://www.cnblogs.com/cxchanpin/p/7287307.html

你可能感兴趣的文章
php_扑克类
查看>>
回调没用,加上iframe提交表单
查看>>
socket总结
查看>>
(安卓)一般安卓开始界面 Loding 跳转 实例 ---亲测!
查看>>
元素和为目标值的子矩阵数量
查看>>
POJ-1287.Network(Kruskal + Prim + Prim堆优化)
查看>>
Mysql 索引优化 - 1
查看>>
LeetCode(3) || Median of Two Sorted Arrays
查看>>
JSDoc规范
查看>>
大话文本检测经典模型:EAST
查看>>
文本主题模型之LDA(一) LDA基础
查看>>
linux基础命令-chgrp/chown/chomd
查看>>
待整理
查看>>
iOS 6
查看>>
Nginx入门篇-基础知识与linux下安装操作
查看>>
一次动态sql查询订单数据的设计
查看>>
C# 类(10) 抽象类.
查看>>
1.linux ping:unknown host www.***.***
查看>>
Swagger自动生成接口文档
查看>>
Jquery瀑布流布局,jQuery Wookmark Load 示例
查看>>