Codeforces Round #313 (Div. 1) Gerald's Hexagon
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's Hexagon的更多相关文章
- 【打CF,学算法——三星级】Codeforces Round #313 (Div. 2) C. Gerald's Hexagon
[CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/C 题面: C. Gerald's Hexagon time limit per tes ...
- Codeforces Round #313 (Div. 2) C. Gerald's Hexagon(补大三角形)
C. Gerald's Hexagon time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #313 (Div. 2) 560C Gerald's Hexagon(脑洞)
C. Gerald's Hexagon time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- 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的网格,让你 ...
- Codeforces Round #313 (Div. 1) A. Gerald's Hexagon
Gerald's Hexagon Problem's Link: http://codeforces.com/contest/559/problem/A Mean: 按顺时针顺序给出一个六边形的各边长 ...
- 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/ ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- 小程序的一个tab切换
<view class="tab-left" bindtap="tab"> <view class="{{tabArr.curHdI ...
- LeetCode212. Word Search II
https://leetcode.com/problems/word-search-ii/description/ Given a 2D board and a list of words from ...
- 《深入浅出MyBatis技术原理与实战》——3. 配置
要注意的是上面那些层次是不能够颠倒顺序的,否则MyBatis在解析文件的时候就会出现异常. 3.1 properties元素 properties是一个属性配置元素,让我们能在配置文件的上下文中使用它 ...
- 详解WordPress中简码格式标签编写的基本方法
WordPress 简码是一种类似于论坛标签的东西,格式类似于把尖括号换成中括号的 Html 标签.简码很多人叫做短代码,但官方的翻译应该是简码,在这里纠正一下. 简码的开发的逻辑比较简单,主要就是添 ...
- ARK登录信息
101,389B,382:仙境353:中心岛380:畸变404:孤岛371:焦土487:灭绝 eaglexmw:389b[65493013] : 初级畸变,高级飞升,TEK全解(有380权限),黑鬼, ...
- [lampp] 不能通过互联网连接数据库 MySQL is not accessable via network
LAMPP安装目录下的/etc/my.cnf文件注释掉skip-networking #skip-networking#skip-networking
- Linux操作命令(六)
本次实验将介绍 Linux 命令中 wc 和 grep 命令的用法. wc grep 1.wc wc命令是一个统计的工具,主要用来显示文件所包含的行.字和字节数. wc命令是word count的缩写 ...
- 2018CCPC 中国大学生程序设计竞赛 网络赛
链接 1.括号序列贪心/CF&51nod原题 [分析]: 贪心,每次到i的时候,假如你要在i里面要卖掉股票,获益是a[i], 肯定要在前面要么:1)把已经卖了的变成不买不卖,需要-a[j], ...
- 【我要学python】open函数的简单用法
open函数 1,使用方法:open('文件路径', '模式',编码方式). 2,最好使用with open as: 省去每一次都需要close()的环节 3,模式介绍: ①w 可写(如果存在,会覆盖 ...
- Android Theme.AppCompat.Light的解决方法
styles.xml中<style name="AppBaseTheme" parent="Theme.AppCompat.Light">提示如下错 ...