codeforces #313 div1 A

捕获一只野生大水题!

首先我们知道边长为L的正三角形含有边长为1的小正三角形为L^2个

那么我们可以通过在六边形的正上,左下,右下补充正三角形使得原图形变成正三角形

然后再将补充的减去即可

 

#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;

typedef long long LL;
LL a[12];
LL ans;

int main(){
	for(int i=1;i<=6;++i)scanf("%I64d",&a[i]);
	ans=(a[1]+a[2]+a[3])*(a[1]+a[2]+a[3]);
	ans=ans-a[1]*a[1];
	ans=ans-a[3]*a[3];
	ans=ans-a[5]*a[5];
	printf("%I64d\n",ans);
	return 0;
	
}

  

posted @ 2016-04-09 16:10  _Vertical  阅读(205)  评论(0编辑  收藏  举报