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. Leetcode 之Length of Last Word(37)

    扫描每个WORD的长度并记录即可. int lengthOfLast(const char *s) { //扫描统计每个word的长度 ; while (*s) { if (*s++ != ' ')/ ...

  2. jenkins上展示html报告【转载】

    转至博客:上海-悠悠 前言 在jenkins上展示html的报告,需要添加一个HTML Publisher plugin插件,把生成的html报告放到指定文件夹,这样就能用jenkins去读出指定文件 ...

  3. LeetCode解题报告—— Rotate List & Set Matrix Zeroes & Sort Colors

    1. Rotate List Given a list, rotate the list to the right by k places, where k is non-negative. Exam ...

  4. 【Mac电脑】Jenkins的安装

    1.JDK自己下载安装喽, 2.下载Jenkins 下载路径:https://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable/2.121.1/jenki ...

  5. AC日记——[SDOI2009]HH去散步 洛谷 P2151

    [SDOI2009]HH去散步 思路: 矩阵快速幂递推(类似弗洛伊德): 给大佬跪烂-- 代码: #include <bits/stdc++.h> using namespace std; ...

  6. Nuget私服使用

    首先前提是师父已经搭好私服环境了(怎么搭建参考https://www.cnblogs.com/liupengblog/archive/2012/09/10/2678508.html). 然后在vs中打 ...

  7. docker容器中文件的上传与下载

    原文地址:传送门 1.上传文件 docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH [OPTIONS]:保持源目标中的链接,例: docker cp ...

  8. Markdown 表情包

  9. bootstrap插件学习-bootstrap.tab.js(读码)

    先看bootstrap-tab.js的结构 var Tab = function ( element ) {} //构造器 Tab.prototype ={} //构造器的原型 $.fn.tab = ...

  10. php漏洞tips

    1.php后缀限制 'php,php3,php4,php5,php6,php7,phpsh,inc,phtml','PHT'; 2.php木马 <?php echo shell_exec($_G ...