#include <bits/stdc++.h>
using namespace std;
char low(char ch) {
if (ch >= 'A' && ch <= 'Z') {
return ch - 'A' + 'a';
} else {
return ch;
}
}
const int MOD = 1000000007;
const string STR = "helloworld";
int tot[20];
int main(void) {
char ch;
while ((ch = getchar()) != EOF) {
ch = low(ch);
for (int i = STR.size() - 1; i >= 0; --i) {
if (ch == STR[i]) {
tot[i] += tot[i - 1];
tot[i] %= MOD;
}
}
if (ch == STR[0]) {
++tot[0];
tot[0] %= MOD;
}
}
printf("%d\n", tot[STR.size() - 1]);
return 0;
}
上面是我的代码,标算写的,两个样例测出来都是刚好多一倍,但是提交是AC的,样例锅了还是数据水了?