您的位置:首页 > 其它

UVA 10079 Pizza Cutting

2013-01-28 21:10 232 查看
大意略。

思路:切豆腐,3刀八块,关键是如何去切。f
-f[n-1] = n,f[0] = 1;

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef long long LL;

LL n;

int main()
{
	while(~scanf("%lld", &n))
	{
		if(n < 0) break;
		printf("%lld\n", (n*n+n)/2+1);
	}
	return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: