Lweb and String
来源:互联网 发布:六十耳顺 七十知天命 编辑:程序博客网 时间:2024/05/08 19:25
Problem Description
Lweb has a string S .
Oneday, he decided to transform this string to a new sequence.
You need help him determine this transformation to get a sequence which has the longest LIS(Strictly Increasing).
You need transform every letter in this string to a new number.
A is the set of letters of S , B is the set of natural numbers.
Every injectionf:A→B can be treat as an legal transformation.
For example, a String “aabc”,A={a,b,c} , and you can transform it to “1 1 2 3”, and the LIS of the new sequence is 3.
Now help Lweb, find the longest LIS which you can obtain fromS .
LIS: Longest Increasing Subsequence. (https://en.wikipedia.org/wiki/Longest_increasing_subsequence)
Oneday, he decided to transform this string to a new sequence.
You need help him determine this transformation to get a sequence which has the longest LIS(Strictly Increasing).
You need transform every letter in this string to a new number.
Every injection
For example, a String “aabc”,
Now help Lweb, find the longest LIS which you can obtain from
LIS: Longest Increasing Subsequence. (https://en.wikipedia.org/wiki/Longest_increasing_subsequence)
Input
The first line of the input contains the only integer T,(1≤T≤20) .
ThenT lines follow, the i-th line contains a string S only containing the lowercase letters, the length of S will not exceed 105 .
Then
Output
For each test case, output a single line "Case #x: y", where x is the case number, starting from 1. And y is the answer.
Sample Input
2aabccacdeaa
Sample Output
Case #1: 3Case #2: 4
这题是我另一个队友写得,这题的关键在于读懂题意,读懂了你会发现,其实就是问你一串字符中有多少个字母出现,然后就没了......
本人比较懒,代码就不写了。
1 0
- Lweb and String
- Lweb and String
- HDU5842-Lweb and String
- hdu5842-Lweb and String
- Lweb and String(set)
- hdu 5842 Lweb and String
- HDU 5842 Lweb and String
- hdu 5842 Lweb and String
- HDU 5842 Lweb and String
- HDU 5842 Lweb and String【】
- hdu 5842 Lweb and String
- HDU 5842Lweb and String
- hdu Lweb and String ( LIS)
- 杭电5842之Lweb and String
- hdoj 5835 Danganronpa 5842 Lweb and String
- hdu 5842 Lweb and String【水题】
- HDU 5842 Lweb and String(水题)
- HDU 5842 Lweb and String (神坑)
- 运动目标跟踪(九)--Struck跟踪原理
- Android tablayout 单纯更改Tab的文字颜色
- Install Kernel 3.10 on CentOS 6.5
- Ai简单绘制档案的图标
- Spring Assert(方法入参检测工具类-断言)
- Lweb and String
- 华为在线训练(9)
- mybatis在xml文件中处理大于号小于号的方法
- Creo二次开发:参数化设计
- 编译出错:configure: error: installation or configuration problem: C++ compiler cannot create executables
- java语言基础
- 查询和解决adb端口占用
- 1347. 环中环 (Standard IO)
- DataWarehouseBasedOnSQLHadoop—学习笔记[1]