http://codeforces.com/contest/559/problem/A

题目大意:按顺序给出一个各内角均为120°的六边形的六条边长,求该六边形能分解成多少个边长为1的单位三角形。

解:

性质1:边长为n的正三角形能够划分成n*n个边长为1的正三角形。

绘图找规律

性质2:延长各边总能找到一个大的正三角形。而且所求等于大三角形减去三个补出来的三个三角形面积

收获:

以后先找规律,看能不能找出一些特征即使不会证明

其次,总的减去部分化为所求假设想求的难以直接求

#include <cstdio>
#include <cstring>
#include <iostream> using namespace std; inline int area(int a){
return a*a;
} int main(){
int a,b,c,d,e,f;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
printf("%d\n",area(a+b+c)-(area(a)+area(e)+area(c)));
return 0;
}

Codeforces Round #313 (Div. 1) Gerald&#39;s Hexagon的更多相关文章

  1. 【打CF,学算法——三星级】Codeforces Round #313 (Div. 2) C. Gerald&#39;s Hexagon

    [CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/C 题面: C. Gerald's Hexagon time limit per tes ...

  2. Codeforces Round #313 (Div. 2) C. Gerald&#39;s Hexagon(补大三角形)

    C. Gerald's Hexagon time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. Codeforces Round #313 (Div. 2) 560C Gerald&#39;s Hexagon(脑洞)

    C. Gerald's Hexagon time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  4. dp - Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess

    Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你 ...

  5. Codeforces Round #313 (Div. 1) A. Gerald's Hexagon

    Gerald's Hexagon Problem's Link: http://codeforces.com/contest/559/problem/A Mean: 按顺时针顺序给出一个六边形的各边长 ...

  6. Codeforces Round #313 (Div. 2)B.B. Gerald is into Art

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/ ...

  7. Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学

    C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/pr ...

  8. Codeforces Round #313 (Div. 1) A. Gerald's Hexagon 数学题

    A. Gerald's Hexagon Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/p ...

  9. Codeforces Round #313 (Div. 2) B. Gerald is into Art 水题

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/560 ...

随机推荐

  1. 手机meta标签(保存下来省的每次都找)

    手机网站Meta标签 手机端特有的Meta标签 1.<meta name="viewport" id="viewport" content="w ...

  2. linux命令(40):at命令

    1.命令格式: at[参数][时间] 2.命令功能: 在一个指定的时间执行一个指定任务,只能执行一次,且需要开启atd进程( ps -ef | grep atd查看, 开启用/etc/init.d/a ...

  3. 机器学习方法(四):决策树Decision Tree原理与实现技巧

    欢迎转载,转载请注明:本文出自Bin的专栏blog.csdn.net/xbinworld. 技术交流QQ群:433250724,欢迎对算法.技术.应用感兴趣的同学加入. 前面三篇写了线性回归,lass ...

  4. Max Points on a Line——数学&&Map

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  5. html和url两种录制方式

    在跟使用Loadrunner工具使用者交流的过程中,经常有人提到这个问题,基于HTML(HyperText Markup Language 超文本置标语言)模式录制 与基于URL(Uniform Re ...

  6. Centos7yum安装LNMP

    (1)安装nginx 0.关闭防火墙 systemctl stop firewald.service systemctl disable firewald.service 1.使用nginx官方提供的 ...

  7. linux 进程命令小结

    top:动态查看进程的变化 ps:将某个时间点的进程运行情况选取下来 ps -l :仅查看自己的bash相关进程 ps -aux :查看系统所有的进程 pstree :列出目前系统上面所有的进程树的相 ...

  8. MySQL workbench中的PK,NN,UQ,BIN,UN,ZF,AI说明

    - PK: primary key (column is part of a pk) 主键- NN: not null (column is nullable) 是否为空  (非空)- UQ: uni ...

  9. 笔试之random7生成random10

    /*头条 已知有个Random7()的函数,返回1到7随机自然数,让利用这个Random7()构造Random10()随机1~10. random7构造1~49,限制到1~40,对10求余再+1 */ ...

  10. go chapter 8 - 初始化对象

    http://blog.haohtml.com/archives/14239 struct定义的属性如果是小写开头的,那么该属性不是public的,不能跨包调用 (implicit assignmen ...