聊城招聘网站建设,织梦做的网站怎么上传视频教程,唐山哪里建设网站好,换空间对网站的影响1 CCPC网络赛 HDU5839 Special Tetrahedron2 题意#xff1a;n个点#xff0c;选四个出来组成四面体#xff0c;要符合四面体至少四条边相等#xff0c;若四条边相等则剩下两条边不相邻#xff0c;求个数3 思路#xff1a;枚举四面体上一条线#xff0c;再找到该线两个端… 1 CCPC网络赛 HDU5839 Special Tetrahedron2 题意n个点选四个出来组成四面体要符合四面体至少四条边相等若四条边相等则剩下两条边不相邻求个数3 思路枚举四面体上一条线再找到该线两个端点相等的点放在一个集合里面。4 要符合条件的话则该集合里面找两个点并且要判断一下。5 注意普通四面体会被重复计算两次正四面体会重复计算六次6 7 8 #include bits/stdc.h9 using namespace std;
10 #define LL long long
11 const double inf 123456789012345.0;
12 const LL MOD 100000000LL;
13 const int N 210;
14 #define clc(a,b) memset(a,b,sizeof(a))
15 const double eps 1e-7;
16 void fre() {freopen(in.txt,r,stdin);}
17 void freout() {freopen(out.txt,w,stdout);}
18 inline int read() {int x0,f1;char chgetchar();while(ch9||ch0) {if(ch-) f-1; chgetchar();}while(ch0ch9) {xx*10ch-0;chgetchar();}return x*f;}
19
20 struct Point {
21 double x,y,z;
22 Point() {}
23 Point(LL _x,LL _y,LL _z):x(_x),y(_y),z(_z) {}
24 Point operator (const Point t) const {
25 return Point(xt.x,yt.y,zt.z);
26 }
27 Point operator -(const Point t) const {
28 return Point(x-t.x,y-t.y,z-t.z);
29 }
30 Point operator *(const Point t) const {
31 return Point(y*t.z-z*t.y,z*t.x-x*t.z,x*t.y-y*t.x);
32 }
33 double operator ^(const Point t) const {
34 return x*t.xy*t.yz*t.z;
35 }
36 double len2(){
37 return x*xy*yz*z;
38 }
39 } p[N];
40
41 bool check(Point a,Point b,Point c,Point d) {
42 return (((a-b)*(a-c))^(a-d))0.0;
43 }
44
45 int l[210];
46 int main() {
47 int T;
48 scanf(%d,T);
49 for(int cas1; casT; cas) {
50 int n,cnt;
51 int ans0,tem0;
52 scanf(%d,n);
53 for(int i1; in; i) scanf(%lf%lf%lf,p[i].x,p[i].y,p[i].z);
54 for(int i1; in; i) {
55 for(int ji1; jn; j) {
56 cnt0;
57 for(int k1; kn; k) {
58 if(ki||kj) continue;
59 Point p1,p2;
60 p1p[k]-p[i];
61 p2p[k]-p[j];
62 if(p1.len2()p2.len2()) {
63 l[cnt]k;
64 }
65 }
66 for(int k0; kcnt-1; k) {
67 for(int hk1; hcnt; h) {
68 Point p1p[l[h]]-p[i],p2p[l[k]]-p[i];
69 if(p1.len2()!p2.len2()) continue;
70 if(check(p[i],p[j],p[l[k]],p[l[h]])) continue;
71 ans;
72 Point p3p[l[k]]-p[l[h]];
73 Point p4p[i]-p[j];
74 if(p1.len2()p3.len2()p4.len2()p3.len2())
75 tem;
76 }
77 }
78 }
79 }
80 ans/2;
81 ansans-2*tem/6;
82 printf(Case #%d: ,cas);
83 printf(%d\n,ans);
84 }
85 return 0;
86 } 转载于:https://www.cnblogs.com/ITUPC/p/5772975.html