Codeforces Round #313 (Div. 2) C
题意:
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<map>
#include<cmath>
using namespace std;
typedef long long ll;
const int N = 1005;
int n;
int a[10]; int main()
{
for(int i = 1; i <= 6; i++)
{
scanf("%d", &a[i]);
}
for(int i = 1; i <= 3; i++)
{
if((a[2] + a[3]) == (a[5] + a[6])) break;
else
{
int f = a[1];
for(int j = 1; j < 6; j++)
{
a[j] = a[j+1];
}
a[6] = f;
}
}
int x = min(a[2], a[6]), y = min(a[3], a[5]);
int l = abs(a[2] - a[6]);
ll sum = 0;
int cnt = a[1];
for(int i = 1; i <= x; i++)
{
sum += (ll)2 * cnt + 1; //加上上面那个等腰梯形的面积
++cnt;
}
sum += (ll) 2 * cnt * l; //加上平行四边形面积
cnt--;
for(int i = 1; i <= y; i++)
{
sum += (ll)2 * cnt + 1; //加上以下那个等腰梯形的面积
--cnt;
}
printf("%I64d\n", sum);
return 0;
}
Codeforces Round #313 (Div. 2) C的更多相关文章
- Codeforces Round #313 (Div. 1)
官方英文题解:http://codeforces.com/blog/entry/19237 Problem A: 题目大意: 给出内角和均为120°的六边形的六条边长(均为正整数),求最多能划分成多少 ...
- 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) B. Equivalent Strings
Equivalent Strings Problem's Link: http://codeforces.com/contest/559/problem/B Mean: 给定两个等长串s1,s2,判断 ...
- 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) D. Equivalent Strings
D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/ ...
- 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. 2) A. Currency System in Geraldion
A. Currency System in Geraldion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/co ...
- Codeforces Round #313 (Div. 2) E. Gerald and Giant Chess (Lucas + dp)
题目链接:http://codeforces.com/contest/560/problem/E 给你一个n*m的网格,有k个坏点,问你从(1,1)到(n,m)不经过坏点有多少条路径. 先把这些坏点排 ...
- Codeforces Round #313 (Div. 1) B. Equivalent Strings DFS暴力
B. Equivalent Strings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559 ...
随机推荐
- HTML 3秒一换轮播(鼠标选中旋转停止定时) 动画案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- mac下selenium+python环境搭建
selenium2+python的环境搭建主要需要python和selenium 1.python mac下自带了python,可以查看版本.当然可以选择安装其它版本的python. 2.seleni ...
- C#实现中国身份证验证问题
C#中国身份证验证,包括省份验证和校验码验证,符合GB11643-1999标准... 今天写的 C#中国身份证验证,包括省份验证和校验码验证,符合GB11643-1999标准... 理论部分: 1 ...
- [转载] 深入了解Java ClassLoader、Bytecode 、ASM、cglib
转载自http://www.iteye.com/topic/98178 一.Java ClassLoader 1,什么是ClassLoader 与 C 或 C++ 编写的程序不同,Java 程序并 ...
- 原生JS—实现图片循环切换及监测鼠标滚动切换图片
今天我们主要讲讲如何使用原生JS实现图片的循环切换的方法以及如何检测鼠标滚动循环切换图片.多余的话我们就不多说了,我们一个一个开始讲吧. 1 原生JS实现图片循环切换 -- 方法一 在上栗子之前我们 ...
- Python的__init__.py用法
python中包的引入,对于大型项目中都会使用到这个功能,把实现不同功能的python文件放在一起,组成不同lib库,然后在其他地方调用. 包,python源文件+__init__.py 模块,pyt ...
- 自己动手修改Robotium代码(上)
Robotium作为Android自动化测试框架,还有许多不完善的地方,也不能满足测试人员的所有要求.那么,本文以四个实际中碰到的问题为例,介绍改动Robotium源码的过程. public bool ...
- org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer
使用hibernate时,在save方法时,报了:org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.In ...
- 分布式缓存之Ehcache与terracotta - Terracotta服务器概念篇
1.介绍 Terracotta服务器为Terracotta产品提供分布式数据平台.Terracotta服务器集群被称为Terracotta服务器阵列(TSA).Terracotta服务器阵列可以从单个 ...
- 加密代理和Retrofit解密Converter
最近在研究安卓的Retrofit框架,服务器的数据全部用加密算法加密了,发现无法使用"com.squareup.retrofit2:converter-gson:2.1.0"Jar ...