摘要:
题意:给定平面内的一些点,求平面内最多有几个点共线。分析:枚举两个点确定一条线段,把所有线段按照斜率排序,然后整理斜率相等的即可获得答案。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>usingnamespace std;#define eps 1.0e-8#define maxn 205struct XPoint{ int x, y; 阅读全文
posted @ 2011-05-15 13:12
undefined2024
阅读(442)
评论(0)
推荐(0)
摘要:
高精度加法,putchar(),getchar()比scanf(),printf()快。效率相差10多倍。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 1000006int f1[maxn], f2[maxn];char ans[maxn];int main(){ //freopen("t.txt", "r", stdin); 阅读全文
posted @ 2011-05-15 12:00
undefined2024
阅读(212)
评论(0)
推荐(0)
摘要:
可以推公式也可以二分,我不会推公式,所以二分。这题之所以可以二分,是因为它符合一个性质,这个性质是,当你确定的a1偏大,利用a1求出的a[n+1]就偏大,大于题目中给出的a[n+1]。同理,偏小则小于。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define maxn 3100#define eps 1.0e-8int n;double a[m 阅读全文
posted @ 2011-05-15 11:35
undefined2024
阅读(210)
评论(0)
推荐(0)