COdeforces 630D Hexagons!
2016-02-20 14:37
357 查看
题目:http://codeforces.com/contest/630/problem/D
代码:
分析:
0 1 2 3
找规律 1 6 12 18 等差数列求和 (t+1*t*6/2
代码:
#include<stdio.h> #include<string.h> #include<math.h> using namespace std; int main() { __int64 t; scanf("%I64d",&t); __int64 sum=1; __int64 n=1; // for(int i=0;i<t;i++) { n=(1+t)*t*3; sum=sum+n; } if(t==0)printf("1"); else printf("%I64d",sum); }
分析:
0 1 2 3
找规律 1 6 12 18 等差数列求和 (t+1*t*6/2
相关文章推荐
- [Algorithm] 使用SimHash进行海量文本去重
- 微软推Azure机器学习工具:Algorithm Cheat Sheet
- mongoose 文档(十) Promises
- django的models部分使用小结
- Atitit.go语言golang语言的新的特性 attilax总结
- Atitit.go语言golang语言的新的特性 attilax总结
- Atitit.go语言golang语言的新的特性 attilax总结
- 查看google chrome和firefox上的cookie
- codeforces 630D Hexagons!
- ZOJ 2855 Google Map
- 几种malloc实现原理 ptmalloc(glibc) && tcmalloc(google) && jemalloc(facebook)
- NetLogon事件ID:5722
- NetLogon事件ID:5723
- golang走起(四)执行命令行
- golang走起(三)list简单使用和interface{}
- GoDaddy开通中文客服电话,沟通不再是问题
- golang走起(二)对象与指针二
- golang走起(一)对象与指针
- Google反编译新工具——Enjarify
- uva 11054 Wine trading in Gergovia