NYOJ-655 光棍的YY AC 分类: NYOJ 2013-12-29 19:24 224人阅读 评论(0) 收藏
#include<stdio.h>
#include<string.h>
char str[210];
int max[210][52]={0};
int sum(int n,int m);
int main(){
int i,k,n,m;
max[1][0]=1;
max[0][0]=1;
for(i=0;i<201;i++)
sum(i,i+1);
scanf("%d",&n);
while(n--){
scanf("%s",str);
m=strlen(str);
i=50;
k=0;
while(i--){
if(k){
printf("%d",max[m][i]);
continue;}
if(max[m][i-1]!=0)k=1;
}
printf("\n");
}
return 0;
} int sum(int n,int m){
int i=50;
while(i--){
max[m+1][i]=max[n][i]+max[m][i];
}
for(i=0;i<50;i++){ max[m+1][i+1]+=max[m+1][i]/10;
max[m+1][i]=max[m+1][i]%10;
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
NYOJ-655 光棍的YY AC 分类: NYOJ 2013-12-29 19:24 224人阅读 评论(0) 收藏的更多相关文章
- Network Saboteur 分类: 搜索 POJ 2015-08-09 19:48 7人阅读 评论(0) 收藏
Network Saboteur Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10147 Accepted: 4849 Des ...
- 欧拉通路-Play on Words 分类: POJ 图论 2015-08-06 19:13 4人阅读 评论(0) 收藏
Play on Words Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10620 Accepted: 3602 Descri ...
- Hardwood Species 分类: POJ 树 2015-08-05 16:24 2人阅读 评论(0) 收藏
Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 20619 Accepted: 8083 De ...
- Power Strings 分类: POJ 串 2015-07-31 19:05 8人阅读 评论(0) 收藏
Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ ...
- 迷之节约 分类: sdutOJ 最小生成树 2015-06-24 19:10 10人阅读 评论(0) 收藏
迷之节约 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 FF超级有钱,最近又买了n个(1 <= n <= 300)小岛,为 ...
- Hdu 1506 Largest Rectangle in a Histogram 分类: Brush Mode 2014-10-28 19:16 93人阅读 评论(0) 收藏
Largest Rectangle in a Histogram Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
- Least Common Ancestors 分类: ACM TYPE 2014-10-19 11:24 84人阅读 评论(0) 收藏
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...
- 二分图匹配 分类: ACM TYPE 2014-10-01 19:57 94人阅读 评论(0) 收藏
#include<cstdio> #include<cstring> using namespace std; bool map[505][505]; int n, k; bo ...
- C语言之void类型及void指针 分类: C/C++ 2015-07-13 11:24 8人阅读 评论(0) 收藏
原文网址:http://www.cnblogs.com/pengyingh/articles/2407267.html 1.概述 许多初学者对C/C 语言中的void及void指针类型不甚理解,因此在 ...
随机推荐
- 在Windows下Mysql如何重置root用户密码
原文链接:http://www.feeldesignstudio.com/2013/05/windows-mysql-root-password-reset 网上的很多在Windows下重置root用 ...
- 解决:JS如何取得当前正在执行的function的名字
代码如下 function getFName(fn){ return (/^[\s\(]*function(?:\s+([\w$_][\w\d$_]*))?\(/).exec(fn.toString( ...
- jquery不熟悉的方法
1.jquery有一个筛选api find. 语法很简单,比如: HTML 代码: <p><span>Hello</span>, how are you?</ ...
- PHP导出excel文件
现在教教你如何导入excel文件: 在我的文件储存里面有一个com文件夹的,将其解压放在ThinkPHP/Library/文件夹里面,然后就是写控制器啦!去调用这个插件: <?php names ...
- highcharts与highstock实例
highcharts实例代码 <head> <title>highcharts报表示例</title> <meta http-equiv="Cont ...
- 苹果Mac OS系统shell命令大全介绍
基本命令 1.列出文件 ls 参数 目录名 例: 看看驱动目录下有什么:ls /System/Library/Extensions 参数 -w 显示中文,-l 详细信息, -a 包括隐藏 ...
- wpf程序热键的一个类
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServi ...
- 【6.24-AppCan移动开发大会倒计时】科大讯飞来了!
6.24 AppCan移动开发者大会进入倒计时,报名通道即将关闭! 50多家移动圈服务商将出席此次大会,讯飞开放平台也将作为参展商,为参会者带去前沿的语音技术.参会者可现场体验最新连续语音识别技术,识 ...
- Android--Fragment的懒加载
我们都知道,fragment放在viewPager里面,viewpager会帮我们预先加载一个,但是当我们要看fragment里面的内容时,我们也许只会去看第一个,不会去看第二个,如果这时候不去实现f ...
- Go安装
http://www.linuxidc.com/Linux/2015-02/113159.htm https://github.com/astaxie/beego http://www.sizeofv ...