3668专题

POJ 3668 Game of Lines(暴力)

题目链接:http://poj.org/problem?id=3668 题意:给定n个点,求一共能够产生多少条互不平行的线,暴力求出所有斜率就好。错了好多次,原因有二:一是一开始没有用set储存斜率,忘记了set的去重功能非要自己判断这个斜率是否出现过,结果出错了;二是标记斜率不存在时习惯性的标记为返回-1,但事实上有斜率为-1的直线存在,思维定式简直能害死人啊! #include<cs

POJ 3668 Game of Lines/洛谷 P2665 水题

题目背景 Farmer John最近发明了一个游戏,来考验自命不凡的贝茜。 题目描述 Farmer John has challenged Bessie to the following game: FJ has a board with dots marked at N (2 ≤ N ≤ 200) distinct lattice points. Dot i has the integer