暑假集训第三周周三赛 STL C - Strange Class 字符相同 SC数
来源:互联网 发布:mysql 5.6参考手册 编辑:程序博客网 时间:2024/05/29 11:13
C - Strange Class
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescription
In Vivid’s school, there is a strange class(SC). In SC, the students’ names are very strange. They are in the same format: $a^{n}b^{n}c^{n}$(a,b,c must not be the same with each other). For example studens whose names are“abc”,”ddppqq” are in SC, however studens whose names are “aaa”,“ab”,”ddppqqq” are not in SC.
Vivid makes friends with so many students, he wants to know who are in SC.
Vivid makes friends with so many students, he wants to know who are in SC.
Input
There are multiple test cases (about 10), each case will give a string S which is the name of Vivid’s friend in a single line.
Please process to the end of file.
[Technical Specification]
$1 \leq |S| \leq 10$.
|S| indicates the length of S.
S only contains lowercase letter.
Please process to the end of file.
[Technical Specification]
$1 \leq |S| \leq 10$.
|S| indicates the length of S.
S only contains lowercase letter.
Output
For each case, output YES if Vivid’s friend is the student of SC, otherwise output NO.
Sample Input
abcbc
Sample Output
YESNO
分析:
依旧是set,与上题不一样的是,这个题要的只是set的长度,也就是里边元素的个数,只要个数等于三,就可以用字符串去判断是否符合要求。
求长度set: s=it.size()
数组:s=strlen(it)
字符串:s=it.length()
0 0
- 暑假集训第三周周三赛 STL C - Strange Class 字符相同 SC数
- 暑假集训第三周周三赛 STL D - 产生冠军
- 暑假集训第三周周三赛 STL E - Gunner 射鸟
- 暑假集训第三周周三赛 STL F - 水果
- 暑假集训第三周周三赛 STL G - Intelligent IME
- 暑假集训第三周周三赛 STL A - So easy 判断集合
- AYIT2017暑假集训第三周周三赛 A
- AYIT2017暑假集训第二周周三赛 C
- 暑假集训第三周周六赛 STL D - 胜利大逃亡
- 暑假集训第四周周三赛F - Knight Moves 骑士的移动 STL
- AYIT2017暑假集训第二周周三赛 A
- AYIT2017暑假集训第二周周三赛 B
- AYIT2017暑假集训第二周周三赛 G
- AYIT2017暑假集训第二周周三赛 D
- AYIT2017暑假集训第二周周三赛 E
- 暑假集训第三周周六赛 搜索 B - Red and Black红黑瓷片
- 暑假集训第三周周六赛 搜索 E - N皇后问题
- 暑假集训第三周周六赛 搜索 F - Oil Deposits 油块
- poj 1573 Robot Motion
- codeblocks一些快捷操作
- linux shell man命令详细介绍-快捷获得帮助信息(2)
- Java的垃圾回收总结
- poj 1390 dp(方盒游戏)
- 暑假集训第三周周三赛 STL C - Strange Class 字符相同 SC数
- Java07—30
- PULL解析XML的运行机制详解
- 数据库MySQL基础——增删查改
- Struts2中iterator
- 黑马程序员------OC 内存管理MRC和autorelease pool
- 6174问题
- 如何学习大数据以及学习曲线
- 数字图像学习1