博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Gym101522 C.Cheering-字符串 (La Salle-Pui Ching Programming Challenge 培正喇沙編程挑戰賽 2017)...
阅读量:5132 次
发布时间:2019-06-13

本文共 1605 字,大约阅读时间需要 5 分钟。

 

 

To boost contestants' performances in the 20th La Salle - Pui Ching Programming Challenge, the organizers have bought N robots to cheer for them. Each robot is supposed to display cheering slogans, letter by letter.

Unfortunately, due to some technical reasons, the display screen of each robot can only display one fixed character. Therefore, the organizers decided to arrange the robots in a row, thus forming a string of N letters (What a waste!). All letters are in uppercase.

The two hosting schools have abbreviated names LSC and PCMS, as we all know. Which of the two names appear (as a substring) in the string more often?

Input

The first and only line of input consists of a string with N uppercase letters.

For all test cases, N ≤ 100.

Output

Let A be the number of occurrences of LSC in the given string.

Let B be the number of occurrences of PCMS in the given string.

If A > B, output LSC.

If A < B, output PCMS.

If A = B, output Tie.

Example

Input
GOLSC
Output
LSC
Input
PCMSISTHEBEST
Output
PCMS
Input
PCMSWILLNEVERBEATLSC
Output
Tie
Input
ADDOILEVERYONE
Output
Tie

代码:

1 #include
2 #include
3 #include
4 #include
5 #include
6 using namespace std; 7 const int N=1e5+10; 8 char s[N]; 9 int main(){10 memset(s,0,sizeof(s));11 while(~scanf("%s",s)){ 12 int len=strlen(s); 13 int num1=0,num2=0; 14 for(int i=0;i
num2)printf("LSC\n"); 23 else if(num1

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/ZERO-/p/9702897.html

你可能感兴趣的文章
搜索引擎的时效性需求满足
查看>>
nodejs笔记五--MongoDB基本环境配置及增删改查;
查看>>
C语言指针的使用例子(1)指针地址的输出
查看>>
JS 获取当前时间
查看>>
Angular官方教程采坑
查看>>
RabbitMQ官方教程一 "Hello World!"
查看>>
7 - Struts.xml各属性说明(待补充)
查看>>
python json.dumps() 中文乱码问题
查看>>
关于a标签
查看>>
排序算法小结
查看>>
hdu 1000-1099计划(31)
查看>>
gevent 协程 使用
查看>>
【解决】client does not support authentication
查看>>
[LeetCode] Best Time to Buy and Sell Stock III
查看>>
使用 DTrace
查看>>
Why is it called “armature” instead of “skeleton”? or perhaps “rig”?
查看>>
2017百度之星初赛
查看>>
认识Python&基础环境搭建
查看>>
AS3 Signals
查看>>
hanlp安装和使用
查看>>