HDU 5842—— Lweb and String & CCPC 网络赛 1011
来源:互联网 发布:歌曲字幕制作软件 编辑:程序博客网 时间:2024/04/28 18:42
题意:
按字母出现的顺序编号,问最长上升子序列。
思路:
最长为26,出现一个新的字母就加上,答案为字母的种数,无聊的题目。
code:
#include <cstdio>#include <cstring>#include <string>#include <iostream>using namespace std;const int N=1e5+5;string s;int st[28];int main(){int T;scanf("%d",&T);for (int ca=1;ca<=T;ca++){memset(st,0,sizeof(st));cin>>s;int ans=0;for (int i=0;i<s.size();i++){st[s[i]-'a']++;if (st[s[i]-'a']==1) ans++;}printf("Case #%d: %d\n",ca,ans);}}
0 0
- HDU 5842—— Lweb and String & CCPC 网络赛 1011
- HDU-5842-Lweb and String【2016CCPC网络赛】
- HDU5842——Lweb and String(CCPC网络赛第11题)
- 【2016-CCPC-K】水题(Lweb and String,hdu 5842)
- 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 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 5842 Lweb and String(水~)
- hive--删除表中的数据truncate
- [LeetCode]--219. Contains Duplicate II
- GitLab & GitHub同时存SSH Key
- NOip2002均分纸牌
- POJ 3691 DNA repairAC自动机加DP
- HDU 5842—— Lweb and String & CCPC 网络赛 1011
- 2016.8.15
- 测试
- Password【NOIP2016提高A组模拟8.15】
- 莫队算法一(小z的袜子)
- 逆波兰表示法(Reverse Polish Notation)
- iOS之UI高级---CoreAnimation框架
- Hdu-5834 Magic boy Bi Luo with his excited tree(树形DP)
- LightOJ 1275:Internet Service Providers