1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
using namespace std; const int maxn = 1e5+5; const int INF = 0x3f3f3f3f; const double eps = 1e-6; const int MOD = 1000000007; typedef long long ll; #define pb push_back
char c,str[] = "PAT"; int a[3],b[3];
int () { #ifdef ONLIGE_JUDGE #else freopen("H:\in.txt","r",stdin); #endif for (int i = 0; ~scanf("%c",&c); ++i) for (int j = 0; j < 3; ++j) if (c == str[j]) a[j]++, b[j] = j ? (b[j-1] + b[j]) % MOD : a[j]; printf("%dn",b[2]); return 0; }
|
近期评论