上一页 1 2 3 4 5 6 7 8 ··· 42 下一页
摘要: 1 /* 2 几何 3 求给定三角形的外接圆圆心 4 方法:求解二元方程组 5 */ 6 #include 7 #include 8 #include 9 #include10 const double pi = acos(-1.0);11 const double eps = 1e-8;12 struct Point{13 double x,y;14 };15 struct Circle{16 Point center;17 double r;18 };19 Point a,b,c,tp;20 Circle cc;21 22 double dis( Point ... 阅读全文
posted @ 2013-12-07 21:35 xxx0624 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 题意:给定N个点,每个点有初始位置和初始速度。问:在哪个时刻 使得所有的点的最大距离值最小。分析:一开始枚举两两之间的最大值,然后在最大值中求一个最小值。。。(WA:题意严重理解不清。。)由两点之间的距离公式(与T一个系数有关)可知,这个公式是典型的抛物线,因此可以进行三分查找答案,正解! 1 /* 2 wa 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using n... 阅读全文
posted @ 2013-12-03 21:15 xxx0624 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 经典的信封装信问题f[ n ] = ( n-1 ) * ( f[ n-1 ]+f[ n-2 ] ) 1 #include 2 #include 3 #include 4 typedef long long int64; 5 const int maxn = 22; 6 int64 a[ maxn ]; 7 8 void init(){ 9 a[ 0 ] = a[ 1 ] = 0;10 a[ 2 ] = 1;11 for( int i=3;i<=20;i++ ){12 a[ i ] = ( i-1 )*(a[ i-2 ] + a[ i-1 ]);13 ... 阅读全文
posted @ 2013-11-25 21:35 xxx0624 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 枚举中间可能出现的天气 1 #include 2 #include 3 #include 4 const int maxn = 1005; 5 double mat[ 5 ][ 5 ]; 6 7 void solve( int L,int R,int n ){ 8 double ans[ 5 ],tp[ 5 ]; 9 double res = 0;10 for( int i=1;i<=n;i++ ){11 if( i==1 ){12 ans[ 1 ] = mat[ L ][ 1 ];13 ans[ 2 ]... 阅读全文
posted @ 2013-11-20 11:57 xxx0624 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 给定n和m个数,询问在小于n的数中 有多少个能整除m中的某个数。。容斥原理。PS:注意64位整数! 1 /* 2 容斥原理 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 typedef long long int64;10 const int maxn = 24;11 int64 num[ maxn ];12 int64 ans;13 int n, m;14 15 int gcd( int a,int b ){16 int r;17 while( b ){18 ... 阅读全文
posted @ 2013-11-13 22:27 xxx0624 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 题意:给N个点,求最多有多少个点在同一直线上方法一:求出所有能形成的直线,两两比较,统计最多有多少条重合。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 typedef long long int64; 9 const int64 maxn = 701; 10 const int64 maxm = 490005; 11 const int64 inf = -123456789; 12 struct Point64{ 13 int x,... 阅读全文
posted @ 2013-11-07 20:39 xxx0624 阅读(338) 评论(0) 推荐(0) 编辑
摘要: By xxx0624Done: ls ls -a ls -l ls /tmp ls -R ls -t FileName color FileName output 1 /* 2 By xxx0624 3 Done: 4 ls 5 ls -a 6 ls -l 7 ls /tmp 8 ls -R 9 ls -t 10 FileName color 11 FileName output 12 */ 13 14 #include 15 #include 16 #include 17 #include 18 #inclu... 阅读全文
posted @ 2013-11-07 09:50 xxx0624 阅读(618) 评论(0) 推荐(0) 编辑
摘要: 用cos sin各种乱搞之后 求出一个公式。。但是怕精度损失厉害,还是暂且贴个公式的,copy别人的。。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main(){ 7 double a,b,c,m,n,l,v; 8 while(scanf("%lf%lf%lf%lf%lf%lf", &a, &c, &b, &n, &l, &m)!=EOF){ 9 v=(double)sqrt((4.0*a*a*b*b*c*c-a*a*(b*b+c*c-m*m 阅读全文
posted @ 2013-10-31 00:29 xxx0624 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 大水题。。求集合的并 1 /* 2 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std; 15 typedef long long int64; 16 //typedef __int64 int64; 17 typedef pair PII; 18 #define MP(a,b) make_... 阅读全文
posted @ 2013-10-30 19:42 xxx0624 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 题意简单预处理之后会发现符合条件的数最多781个。。。所以打表。。 1 /* 2 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std; 15 typedef long long int64; 16 //typedef __int64 int64; 17 typedef pair PII; 1... 阅读全文
posted @ 2013-10-30 19:23 xxx0624 阅读(527) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 42 下一页