zoukankan      html  css  js  c++  java
  • 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
    ",ans);
    	return 0;
    	
    }
    

      

  • 相关阅读:
    第五周
    第四周
    第三周作业
    第二周编程总结
    编程总结(3)
    编程总结(2)
    编程总结(1)
    第七周作业
    第六周作业
    第五周作业
  • 原文地址:https://www.cnblogs.com/joyouth/p/5371892.html
Copyright © 2011-2022 走看看