题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1290

思路:

n条直线最多能将一个平面分成几个区域
其递推公式即为:f(n)=f(n-1)+n;
递推一下,就得到f(n)=1/2*(n*n+n)+1;

n个平面最多能将一个空间分成几个区域
递推公式即为:g(n)=g(n-1)+f(n-1);
递推一下,就得到通项公式:g(n)=(n*n*n+5*n+6)/6;

 #include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string> using namespace std; int main()
{
__int64 n;
while(scanf("%I64d",&n)!=EOF)
{
printf("%I64d\n",(n*n*n+*n+)/);
}
return ;
}

hdu 1290 切糕的更多相关文章

  1. hdu 1290

    http://www.cnblogs.com/songacm/p/3537419.html 引用自这篇博客,真·大神

  2. HDU 1290 献给杭电五十周年校庆的礼物

    题解:http://www.cnblogs.com/forever97/p/3522238.html #include <cstdio> int main() { int n; while ...

  3. hdu 1290 竭诚为杭州电礼物50周年

    专门为杭州电50周年礼事 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tot ...

  4. HDU 1290 献给杭电五十周年校庆的礼物(面分割空间 求得到的最大空间数目)

    传送门: 献给杭电五十周年校庆的礼物 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...

  5. HDU题解索引

    HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsu ...

  6. 2018年暑假ACM个人训练题7 题解报告

    A:HDU 1060 Leftmost Digit(求N^N的第一位数字 log10的巧妙使用) B:(还需要研究一下.....) C:HDU 1071 The area(求三个点确定的抛物线的面积, ...

  7. ACM_平面、空间分割问题(递推dp)

    折线分割平面 Time Limit: 2000/1000ms (Java/Others) Problem Description: 我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要 ...

  8. hdu1290

    由二维的切割问题可知,平面切割与线之间的交点有关,即交点决定射线和线段的条数,从而决定新增的区域数. 当有n-1个平面时,切割的空间数为f(n-1).要有最多的空间数.则第n个平面需与前n-1个平面相 ...

  9. HDU 献给杭电五十周年校庆的礼物 1290 递推

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1290 题目大意: n刀最多可以把一块蛋糕切多少块 题目分析: 假如我们按照立体考虑的话,这题就非常不 ...

随机推荐

  1. Android Sqlite 数据库版本更新

      Android Sqlite 数据库版本更新 http://87426628.blog.163.com/blog/static/6069361820131069485844/ 1.自己写一个类继承 ...

  2. 利用LruCache为GridView异步加载大量网络图片完整示例

    MainActivity如下: package cc.testlrucache; import android.os.Bundle; import android.widget.GridView; i ...

  3. 水面shader 线性擦除

    // Upgrade NOTE: replaced 'PositionFog()' with multiply of UNITY_MATRIX_MVP by position // Upgrade N ...

  4. r-cnn学习系列(三):从r-cnn到faster r-cnn

    把r-cnn系列总结下,让整个流程更清晰. 整个系列是从r-cnn至spp-net到fast r-cnn再到faster r-cnn.  RCNN 输入图像,使用selective search来构造 ...

  5. django的前后的结合,search搜索功能案例

    利用django的Q()功能可以很好的展开搜索功能 假设我要做个这样的搜索功能

  6. java前后台之间传值的几种方式

    自己写的代码太少,有时候前后台传值还写的不是很熟练,现在总结一下,加深下印象. 1.jquery的Ajax传值 ---->前台到后台 期望功能:把前台用户输入的信息保存在数据库里. 前台jsp代 ...

  7. 【leetcode】First Missing Positive

    First Missing Positive Given an unsorted integer array, find the first missing positive integer. For ...

  8. vs2008与windbg的使用

    WinDbg是微软发布的一款相当优秀的源码级(source-level)调试工具,可以用于Kernel模式调试和用户模式调试,还可以调试Dump文件.使用windgb进行程序调试是一个很有必要的技能. ...

  9. Java中使用Socket实现服务器端和客户端通讯

    创建服务器端serverSocket import java.io.BufferedReader; import java.io.IOException; import java.io.InputSt ...

  10. Python~if,while,for~顺序,判断,循环

    if A: for -in : while x: if A:elif:else:       不能直接用int进行迭代,而必须加个range.     range(len(L))     int ob ...