1138
来源:互联网 发布:丹尼斯约翰逊数据 编辑:程序博客网 时间:2024/06/02 18:16
[提交][状态][讨论版]
题目描述
Alice, Kate and Susan are sisters. One day, their parents went to work and left them home. They had nothing to do at home besides eating candy. So their mother also left them with N candies. Each of them can eat some candies, but the total number cannot be more than N. It’s allowed that someone eat nothing. By given N, your task is to determine how many different ways they take candies.
输入
Just only one integer N and 0<=N<=3000.
输出
Print the number of such ways.
样例输入
13
样例输出
420
提示
来源
2012.03
#include<stdio.h>int main(){ long long i,n,num=0; while(scanf("%lld",&n)!=EOF) {for(i=1;i<=n+1;++i) num+=i*(i+1)/2; printf("%lld\n",num); num=0;} return 0;}
0 0
- 1138
- 1138
- TFOJS-1138
- hoj 1138
- codevs 1138
- sdnu 1138
- lightoj 1138
- 玲珑 1138
- ZOJ 1138(模拟)
- Hoj LC-Display 1138
- 九度 1138
- NOJ [1138] Honeycomb
- NOJ 1138 Honeycomb
- akoj-1138-游戏编码
- 1138 代码等式[C]
- 九度oj 1138
- 1138 -- 游程编码
- light oj 1138
- Ubuntu下安装qq
- 学习中遇到问题--记录
- 多线程--callable、Future、FutureTask
- 51nod_1305 Pairwise Sum and Divide(数学规律)
- oracle 12c pdb与cdb
- 1138
- vmware中hadoop的linux环境集群配置环境准备
- LeetCode笔记:125. Valid Palindrome
- 原型模式(创建类)
- 关于 tomcat 集群中 session 共享的三种方法
- 最大子方阵
- LDD之中断
- 数据结构与算法(C语言版)__冒泡排序
- 【解决】java.net.BindException: Address already in use: JVM_Bind