Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
24615 | yuanjiabao | 【S】T1 | C++ | 通过 | 100 | 208 MS | 260 KB | 1596 | 2024-01-08 13:31:26 |
#include<iostream> using namespace std; #define int long long const int N=110; using int128=__int128_t; int n; struct node{int x,y,b,id;}a[N]; void init(){ cin>>n; for(int i=1;i<=n;i++){ int x,y,l;cin>>x>>y>>l; a[i]={x,y,x+y+l,i}; } } int f[N]; inline int fpow(int a,int b){ int c=1; for(;b;b>>=1,a=a*a)if(b&1)c=c*a; return c; } bool tag[N]; inline bool cmpx(const node&A,const node&B){return A.x<B.x||(A.x==B.x&&A.id<=B.id);} inline bool cmpy(const node&A,const node&B){return A.y<B.y||(A.y==B.y&&A.id<=B.id);} inline bool cmpb(const node&A,const node&B){return A.b<B.b||(A.b==B.b&&A.id<=B.id);} signed main(){ // freopen("triangle.in","r",stdin); // freopen("triangle.out","w",stdout); init(); int128 ans=0; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ for(int k=1;k<=n;k++){ int x=a[i].x,y=a[j].y,b=a[k].b; for(int t=1;t<=n;t++)tag[t]=cmpx(a[t],a[i])&&cmpy(a[t],a[j])&&cmpb(a[k],a[t]); if(!tag[i]||!tag[j]||!tag[k])continue; int c=0; c+=tag[i];tag[i]=false; c+=tag[j];tag[j]=false; c+=tag[k];tag[k]=false; int cnt=0; for(int t=1;t<=n;t++)cnt+=tag[t],tag[t]=false; if(b-x-y<=0)continue; int s=(b-x-y)*(b-x-y); ans+=fpow(-1,cnt)*fpow(-2,c-1)*s; } } } if(ans&1)printf("%lld.5",(int)(ans/2)); else printf("%lld.0",(int)(ans/2)); return 0; }