1093 Count PAT’s (25 分)
The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.

Now given any string, you are supposed to tell the number of PAT’s contained in the string.

Input Specification:
Each input file contains one test case. For each case, there is only one line giving a string of no more than 10
​5
​​ characters containing only P, A, or T.

Output Specification:
For each test case, print in one line the number of PAT’s contained in the string. Since the result may be a huge number, you only have to output the result moded by 1000000007.

Sample Input:
APPAPT
Sample Output:
2


/*分析:要想知道构成多少个PAT,那么遍历字符串后对于每一A,它前面的P的个数和它后面的T的个数的乘积就是能构成的PAT的个数。然后把对于每一个A的结果相加即可~辣么就简单啦&

【PAT (Advanced Level) Practice】1093 Count PAT‘s (25 分)相关推荐

  1. 【PAT (Advanced Level) Practice】1051 Pop Sequence (25 分)

    1051 Pop Sequence (25 分) Given a stack which can keep M numbers at most. Push N numbers in the order ...

  2. 【PAT (Advanced Level) Practice】1037 Magic Coupon (25 分)

    题意: 给出两个集合,从这两个集合里面选出数量相同的元素进行一对一相乘,求能够得到的最大乘积之和. 题解: 对每个集合,将正数和负数分开考虑,将每个集合里的整数从大到小排序:将每个集合里的负数从小到大 ...

  3. PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cu ...

  4. 【PAT (Advanced Level) Practice】1120 Friend Numbers (20 分)

    1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same ...

  5. 【PAT (Advanced Level) Practice】1041 Be Unique (20 分)

    1041 Be Unique (20 分) Being unique is so important to people on Mars that even their lottery is desi ...

  6. 【PAT (Advanced Level) Practice】1050 String Subtraction (20 分)

    C/C++中整型数组的下标类型不一定为整型,C C++语言下数组性质与散列有些类似,即散列中的键值对:下标即为关键码,关键码通过散列函数映射得到元素即为值 下标可以为整型,也可以为字符型,简单案例如下 ...

  7. PAT (Advanced Level) Practice - 1107 Social Clusters(30 分)

    题目链接:点击打开链接 题目大意:一个"社交集群"是指部分兴趣爱好相同的人的集合.你需要找出所有的社交集群. 解题思路:并查集思路,轮到第几个人时,以它的 id 为 root,然后 ...

  8. PAT (Advanced Level) Practice 题解代码 - II (1051-1100)

    PAT PAT (Advanced Level) Practice - II(1051-1100) -------------------------------------------------- ...

  9. PAT (Advanced Level) Practice 1043 Is It a Binary Search Tree (25 分) 凌宸1642

    PAT (Advanced Level) Practice 1043 Is It a Binary Search Tree (25 分) 凌宸1642 题目描述: A Binary Search Tr ...

最新文章

  1. C#教程4:数据类型
  2. 15拆分成3个不同的自然数_15个小时搜救破拆,他磨破3双手套营救出4个生还者...
  3. XMPPFramework导入
  4. Deep Learning 论文笔记 (2): Neural network regularization via robust weight factorization
  5. Django搭建简易博客
  6. python双素数_python双素数_用Python打印100以下的所有双素数对
  7. wpf treeview调整子菜单间距_完全由C编写,高度可移植,超级牛逼的菜单架构!...
  8. ros openwrt 分流_常平:推进“截污大会战”补贴助力企业雨污分流
  9. rpm安装mysql5.6.37_MySQL之—RPM方式安装MySQL5.6 代码实例详解
  10. matlab delay用法,请教Vensim中DELAY1I函数使用的单位设置
  11. (一)Multisim安装与入门
  12. BMS锂电池管理系统如何增加蓝牙模块芯片
  13. 文明与征服汉尼拔阵容技能推荐
  14. java 调用 yed 绘制 流程图_流程图绘制软件──yEd
  15. Vivo 监控系统演进之路
  16. 读《饥饿的盛世-乾隆时代的得与失》
  17. Kubernetes部署
  18. 分布式数据库:如何正确选择分片键?
  19. 软件测试周刊(第39期):我们必须全力以赴,同时又不抱持任何希望。
  20. 广州.NET微软技术俱乐部微信群有用信息集锦(10) - 大量json数据压缩方案

热门文章

  1. python xarray DataArray 用法
  2. error C1004 发现意外的文件尾
  3. c++ 遍历多级目录
  4. 生成多个互不重叠的不同半径圆
  5. libcublas.so: cannot open shared object file
  6. 在Ubuntu中用anaconda快速安装opencv3
  7. python 图像数据类型及颜色空间转换
  8. android wifi调试
  9. 谷歌开发专家带你学AI
  10. directshow c++ 设置 曝光_DirectShow 接口访问相机参数设置方法