__int64 C(__int64 n, __int64 m){__int64 s = 1;int i, j;for (i=1,j=n; i<=m; i++, j--)s = s * j / i;return s;}void init(){ for(int i=0;i<maxn;i++){ c[i][0]=1; c[i][i]=1; for(int j=1;j<i;j++) c[i][j]=c[i-1][j-1]+c[i-1][j]; }} Read More
计算几何好题View Code #include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>#include<algorithm>using namespace std;const double eps =1e-9;const double PI = acos(-1);struct point { double x,y;}a[1000];double b[2000];__int64 C(int a,int b){ int i; __int64 aa=a,bb Read More
蛮2巧妙的思路,有点被标记了,才去更新这个点所能更新的最短路径,;此时要利用floyd的思想View Code #include<stdio.h>#include<string.h>const int INF = 999999999;int n,m,q;int map[310][310];int vis[310];void floyd(int x){ int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++) if(map[i][x]+map[x][j]<map[i][j]) map[i][j]= map[i]... Read More