hdu 1396
来源:互联网 发布:淘宝订单监控 编辑:程序博客网 时间:2024/06/05 06:40
递推,找规律
#include <iostream>#include <cstdio>using namespace std;int count[510];int main(){count[1]=1;int i,j;for(i=2;i<=500;i++){int t=count[i-1];for(j=1;j<=i;j++) t=t+i+1-j;for(j=1;i-j>=j;j++) t=t+i-j+1-j;count[i]=t;}int n;while(cin>>n) cout<<count[n]<<endl;return 0;}
- hdu 1396
- HDU 1396 Counting Triangles
- HDU 1396 Counting Triangles
- HDU 1396 Counting Triangles
- HDU 1396 && ZJU 1629
- HDU 1396 Counting Triangles
- hdu 1396 Counting Triangles
- HDU 1396 Counting Triangles
- HDU 1396 Counting Triangles
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- poj2362
- 出错:PhoneFactory.getDefaultPhone must be called from Looper thread
- 选择法降序与折半查找法
- delete 与 delete[] 的区别
- VC++获取屏幕大小第三篇 物理大小GetDeviceCaps 下
- hdu 1396
- java如何把时间格式转为毫秒
- Oracle 11g R1和R2官方下载地址
- 。。。
- chapter 1: windows错误处理
- win7安装vmware8.0后键盘鼠标不起作用
- iOS基础笔记
- 每日一Lua(5)-迭代器与泛型for
- c++ noteII