题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1505

题意:技巧题,就是一行字符串中,每个字母出现的次数互不相同,复即为酷的单词。

解题思路:看看题意,再结合案例,就能明白了只需要对字符串中的每个字符进行统计个数就行。

AC代码:

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
const int M=+;
int n,ans,a[M],b[M];
char s[M];
int main()
{
int n,ca=;
while(scanf("%d",&n)==)
{
ans=;
for(int i=;i<n;i++)
{
memset(a,,sizeof(a));
memset(b,,sizeof(b));
int f=;
scanf("%s",s);
int len=strlen(s);
if(len==) continue;
for(int j=;j<len;j++) a[s[j]-'a']++;
for(int j=;j<;j++)
{
if(a[j]) b[a[j]]++;
if(b[a[j]]>){ f=;break;}
}
if(f) ans++;
}
printf("Case %d: %d\n",ca++,ans);
}
return ;
}

CSU 1505 酷酷的单词 湖南省赛第十届题目的更多相关文章

  1. Kick the ball!(dfs)湖南省赛第十届

    Problem K: Kick the ball! Time Limit: 1 Sec  Memory Limit: 128 MB  Special Judge Submit: 109  Solved ...

  2. ## [湖南省赛2019]Findme ###

    [湖南省赛2019]Findme 1.题目概述 2.解题过程 010打开这几张图片 先简单分析一下这几张图片 简单分析 1.png 从外观上,1.png明显高度太低,需要更改 2.png 2.png末 ...

  3. CSU 1505: 酷酷的单词【字符串】

    Description 输入一些仅由小写字母组成的单词.你的任务是统计有多少个单词是“酷”的,即每种字母出现的次数都不同.比如ada是酷的,因为a出现2次,d出现1次,而1和2不同.再比如,banan ...

  4. csuoj 1505: 酷酷的单词

    http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1505 1505: 酷酷的单词 时间限制: 1 Sec  内存限制: 128 MB 提交: 340  ...

  5. 2017 湖南省赛 K Football Training Camp

    2017 湖南省赛 K Football Training Camp 题意: 在一次足球联合训练中一共有\(n\)支队伍相互进行了若干场比赛. 对于每场比赛,赢了的队伍得3分,输了的队伍不得分,如果为 ...

  6. 2016湖南省赛----G - Parenthesis (括号匹配)

    2016湖南省赛----G - Parenthesis (括号匹配)   Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of lengt ...

  7. 2016湖南省赛----A 2016 (同余定理)

    2016湖南省赛----A 2016 (同余定理) Description  给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 ...

  8. hdu6578 2019湖南省赛D题Modulo Nine 经典dp

    目录 题目 解析 AC_Code @ 题目 第一题题意是一共有{0,1,2,3}四种数字供选择,问有多少个长度为n的序列满足所有m个条件,每个条件是说区间[L,R]内必须有恰好x个不同的数字. 第二题 ...

  9. 2016湖南省赛 I Tree Intersection(线段树合并,树链剖分)

    2016湖南省赛 I Tree Intersection(线段树合并,树链剖分) 传送门:https://ac.nowcoder.com/acm/contest/1112/I 题意: 给你一个n个结点 ...

随机推荐

  1. c# 获取MAC IP TCP列表

    转载自baidu:http://hi.baidu.com/jackeyrain/item/ff94efcfd5cf3a3099b498e9 namespace Public { public clas ...

  2. C#世界中的委托

    委托是C#最重要的特性之一,C#后面的所有特性基本都是建立在委托的基础上的. 1.C#委托是什么? 可以把C#的委托理解为函数的一个包装,它使得C#中的函数可以作为参数来被传递.如果你学过C++,可以 ...

  3. POJ 1631 Bridging signals(LIS O(nlogn)算法)

    Bridging signals Description 'Oh no, they've done it again', cries the chief designer at the Waferla ...

  4. Java之网络请求工具类(依赖:org.apache.http;注:HttpClient 4.4,HttpCore 4.4)

    到此处可以去下载依赖包:http://hc.apache.org/downloads.cgi import java.util.List; import org.apache.http.HttpSta ...

  5. 基础-函数3(IIFE立即执行函数)

    参考链接: http://benalman.com/news/2010/11/immediately-invoked-function-expression/#iife http://segmentf ...

  6. C# 获取路径中文件名、目录、扩展名等

    string path = "C:\\dir1\\dir2\\foo.txt"; string str = "GetFullPath:" + Path.GetF ...

  7. Python 学习之urllib模块---用于发送网络请求,获取数据(3)

    上节内容,是得到了省/直辖市编码,如web='http://m.weather.com.cn/data5/city01',我们需要继续获取此接口的数据,于是进行下面的操作 for  i  in   b ...

  8. TMS IntraWeb 5.4.1.1 for XE6 (适配Intraweb14.0.32)

    文件夹内含有我自己已经编译好的bpl,仅供大家学习使用,请支持正版!!导入ParaInstalarXE6.groupproj后,逐个编译安装即可. 链接:http://pan.baidu.com/s/ ...

  9. Junit4拓展工具JCategory与Testng的Group功能比较

    前言 笔者前段时间分享过一遍文章,关于如何通过引入新注解来扩展Junit4,以解决Process上的问题: JUnit扩展:引入新注解Annotation 最近在跟外面的同事聊的时候,得知Testng ...

  10. bzoj 1004 1004: [HNOI2008]Cards burnside定理

    1004: [HNOI2008]Cards Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1668  Solved: 978[Submit][Stat ...