| 比赛 | 20120619 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | FBI序列 | 最终得分 | 100 |
| 用户昵称 | 1azyReaper | 运行时间 | 0.003 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2016-04-22 09:01:06 | ||
#include <fstream>
#include <algorithm>
#include <cstring>
using namespace std;
ifstream fin("fbi.in");
ofstream fout("fbi.out");
int main()
{
int a=0,b=0,c=0;
string str;
fin>>str;
for(int i=str.length()-1;i>=0;i--)//
{
if(str[i]=='F')
a+=b;
if(str[i]=='B')
b+=c;
if(str[i]=='I')
c++;
}
fout<<a<<endl;
return 0;
}//我也不知道这是什么奇怪的算法。。。