标签:
第一排第i个点和第二排第j个点相连,在这条线段上会产生(a-i)*(j-1)个交点,
以此类推,推公式即可。
#include<cstdio> #define ll long long ll a,b; int cas=1; int main() { while(~scanf("%d%d",&a,&b)&&(a||b)) printf("Case %d: %lld\n",cas++,a*(a-1)/2*b*(b-1)/2); return 0; }
8 UVA 10790 How Many Points of Intersection?
标签:
原文地址:http://blog.csdn.net/u011032846/article/details/45372213