#include<iostream>
#include<string>
#include<cstring>
void priTable();
using namespace std;
];
int main()
{
    int n;
    priTable();
    ){
        cout<<arr[n-]<<endl;
    }
    ;
}
void priTable(){
    arr[]=;
    ";
    ;
    string next="";
    ;i<=;++i)
    {
        ;j<s.length();){
            char temp=s[j];
            ;
            while(s[j]==temp){
                j++;num++;
            }
            next+='+num;
            next+=temp;
        }
        arr[i]=next.length();
        s=next;
        next="";
    }
}

hdu--4148--Length of S(n)的更多相关文章

  1. HDU 4148 Length of S(n)(字符串)

    题目 字符串处理 题意要猜,解析见代码: /* 这题每个S(n)是描述S(n-1)值 例如: S(1)=1; S(2)=11;即描述S(1)有1个1=11 S(3)=21;即描述S(2)有2个1=21 ...

  2. 《Pro AngularJS》学习小结-02

    上一篇的项目只有一个单独的模板页面,加入了相应的controller,filter,使得页面上的数据能够动态的变化.现在我们开始建立并整合多个模板,加入购物车模块和结账checkout模块. 一.在页 ...

  3. hdu 1503, LCS variants, find a LCS, not just the length, backtrack to find LCS, no extra markup 分类: hdoj 2015-07-18 16:24 139人阅读 评论(0) 收藏

    a typical variant of LCS algo. the key point here is, the dp[][] array contains enough message to de ...

  4. HDU 2227 Find the nondecreasing subsequences (DP+树状数组+离散化)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2227 Find the nondecreasing subsequences             ...

  5. (HDU 5558) 2015ACM/ICPC亚洲区合肥站---Alice's Classified Message(后缀数组)

    题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5558 Problem Description Alice wants to send a classi ...

  6. [C#] 逆袭——自制日刷千题的AC自动机攻克HDU OJ

    前言 做过杭电.浙大或是北大等ACM题库的人一定对“刷题”不陌生,以杭电OJ为例:首先打开首页(http://acm.hdu.edu.cn/),然后登陆,接着找到“Online Exercise”下的 ...

  7. hdu 1503 Advanced Fruits

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1503 思路:这是一道最长公共子序列的题目,当然还需要记录路径.把两个字符串的最长公共字串记录下来,在递 ...

  8. HDU 1892 See you~ (二维树状数组)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1892 See you~ Problem Description Now I am leaving h ...

  9. HDU 5938 Four Operations(四则运算)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  10. HDU 5860 Death Sequence(死亡序列)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

随机推荐

  1. 使用linux sort给一个文件里的内容按规则排序

    任务:report.txt文件里有以下内容:记录了一些方法的执行时间,要求按执行时间降序排列. void com.dustpan.zeus.core.service.MergeService.star ...

  2. Hugo快速搭建Blog

    以往我们搭建blog要么学习一个编程语言+Web开发框架,要么使用现成的blog系统(如WordPress).其实我们还可以使用Hugo.Hugo是由Go语言实现的静态网站生成器,它不需要数据库,所以 ...

  3. CentOS上安装Hadoop2.7,添加数据节点,运行wordcount

    安装hadoop的步骤比较繁琐,但是并不难. 在CentOS上安装Hadoop2.7 1. 安装 CentOS,注:图形界面并无必要 2. 在CentOS里设置静态IP,手工编辑如下4个文件 /etc ...

  4. Redis配置文件redis.conf参数配置详解

    ########################################## 常规 ########################################## daemonize n ...

  5. hdoj 1251 字典树||map

    统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submi ...

  6. Oracle存储过程、包、方法使用总结

    /** *@author:zhengwei *@date:2017-04-28 *@desc:存储过程用法总结 */ CREATE OR REPLACE PROCEDURE MYPROCEDURE(P ...

  7. spring框架-spring.xml配置文件

    运行的时候会报错的,因为写到<bean>标签里面去了,肯定会报错的,要记得把注释删掉,就不会报错了,这样写注释是为了方便下次自己看. <?xml version="1.0& ...

  8. 面向对象15.3String类-常见功能-获取-2

    public class String_APImethod {/* * 1.4获取字符串中的一部分字符串,也叫字符串 * String substring(int beginIndex, int en ...

  9. POJ 2251 三维BFS(基础题)

    Dungeon Master Description You are trapped in a 3D dungeon and need to find the quickest way out! Th ...

  10. ASP.NET Core 开源论坛项目 NETCoreBBS

    ASP.NET Core 轻量化开源论坛项目,ASP.NET Core Light forum NETCoreBBS 采用 ASP.NET Core + EF Core Sqlite + Bootst ...