poj 3790 Recursively Palindromic Partitions (递推)
2024-10-11 06:34:10
题意:求输入的数字的递归回文。
思路:答案等于这个数字一半之前的所有的 之和。
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std; int main()
{
int ca, t, i, j, x;
int f[];
f[] = ; f[] = ;
for(i = ; i <= ; i++)
{
f[i] = ;
for(j = ; j <= i/; j++)
f[i] += f[j];
} cin>>t;
for(ca = ; ca <= t; ca++)
{
cin>>x;
printf("%d %d\n", ca, f[x]);
}
return ;
}
最新文章
- WIN7下VS2008生成Detours3.0
- mac 10.9 安装 gevent
- Objective C 快速入门学习五
- C++类的成员函数使用的一些小总结
- [设计模式] 7 桥接模式 bridge
- python 利用pop3接收邮件并保存附件
- NUnit使用详解(一)
- 为 Devops 和系统管理员提供的 400+ 免费资源
- Android:View颤抖的动画效果代码
- PHP数组基本排序算法和查找算法
- 剑指Offer——算法复杂度中的O(logN)底数是多少
- Msys+MinGW编译VLC
- 使用伪类before和after
- html 表单input录入内容校验
- svn命令使用;
- 单点登录SSO的原理及实现方式总结
- mysqldump: Couldn&#39;t execute &#39;SHOW VARIABLES LIKE &#39;ndbinfo_version&#39;&#39;: Native table &#39;performance_schema&#39;.&#39;session_variables&#39; has the wrong structure (1682)
- 【C#】Using的一个比较好的语言文字解释
- python监控端口脚本[jkport2.0.py]
- Javaworkers团队最终项目总结
热门文章
- 路由器开发板上的TTL线连接方法
- oracle里如何将两个日期的时间差返回**时**分的格式
- 搭建Asp.Net MVC4
- ubuntu 12.04 搭建nginx + php + mysql +phpmyadmin
- 2006: [NOI2010]超级钢琴 - BZOJ
- MemSQL Start[c]UP 2.0 - Round 2 - Online Round
- error C2061: syntax error : identifier &#39;__RPC__out_xcount_part&#39;
- 【转】System.DateTime.Now.ToString()的一些用法
- Codeforces Round #256 (Div. 2) Multiplication Table
- Eclipse改变外观,护眼模式