C.Cheering

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<iostream>
2 #include<cstring>
3 #include<cstdio>
4 #include<cmath>
5 #include<algorithm>
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<len;i++){
15 if(s[i]=='L'){
16 if(s[i+1]=='S'&&s[i+2]=='C'&&i+2<len)num1++;
17 }
18 if(s[i]=='P'){
19 if(s[i+1]=='C'&&s[i+2]=='M'&&s[i+3]=='S'&&i+3<len)num2++;
20 }
21 }
22 if(num1>num2)printf("LSC\n");
23 else if(num1<num2)printf("PCMS\n");
24 else printf("Tie\n");
25 }
26 return 0;
27 }

最新文章

  1. ASP.NET MVC5+EF6+EasyUI 后台管理系统(5)-EF增删改查
  2. 使用SecureCRT在远程主机和本地之间传输文件
  3. mysql 启动服务
  4. iOS开发环境C语言基础
  5. PAT (Basic Level) Practise:1001. 害死人不偿命的(3n+1)猜想
  6. Linux下各硬件装置的文件名
  7. js父窗口opener与parent
  8. 【CDOJ931】Car race game(树状数组求逆序)
  9. reStructuredText(.rst)语法规则快速入门
  10. Hibernate 系列教程7-双向一对一
  11. 201521123088《Java程序设计》第13周学习总结
  12. Django REST framework+Vue 打造生鲜超市(五)
  13. 磁共振成像SENSE 并行加速重建 g-factor计算方法(待更新)
  14. 基于SpringBoot搭建应用开发框架(二) —— 登录认证
  15. SSH(Spring Struts2 Hibernate)框架整合(xml版)
  16. BZOJ1095:[ZJOI2007]Hide 捉迷藏(动态点分治)
  17. Ionic 中控件点击延迟的处理
  18. day_4.28 py
  19. 为什么static数据成员一定要在类外初始化?(转)
  20. C++11标准的智能指针、野指针、内存泄露的理解(日后还会补充,先浅谈自己的理解)

热门文章

  1. Hie with the Pie POJ - 3311
  2. TI C6000 优化进阶:循环最重要!
  3. redis配置密码 redis常用命令
  4. Not a git repository (or any of the parent directories): .git解决
  5. Java Integer于Int 进行==双等于的内存比较时的一些问题说明
  6. fetch 使用记录
  7. WPF控件开发(2) 自动完成(AutoComplete)-1
  8. sql语句查询数据库案例
  9. vue知识
  10. POJ2796 Feel Good -- 单调队列