PTA A1093 Count PAT's:题目中明确要求

题目要求

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.


这句话很重要!
如果能够偶理解,当字符串很长时,那么很可能其中一个A的PTA就会超过1000000007,所以题目的意思是:每一个A得到的结果都要先取模,而不是最后再取
如果最后才取,那么最后两个检测点会报错。

发布了146 篇原创文章 · 获赞 42 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/SmartLoveyu/article/details/94658432