题目:https://codeforces.com/problemset/problem/1505/C
题解:根据题目和案例可以知道,这个是和斐波那契有关
HELP
7 4 11 15 YES
AID
0 8 3 NO
MARY
12 0 17 24 NO
ANNA
0 13 13 0 YES
MUG
12 20 6 YES
//如果前两数之和超过26,则减去26再对比
CUP
2 20 15 NO
SUM
18 20 12 YES
PRODUCT
15 17 14 3 20 2 19 NO
//注意:如果长度小于3这直接输出YES
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long int ll;
int a[10];
int main()
{
string s;
cin >> s;
bool xxx = 1;
if (s.size() > 2)
{
for (int i = 0; i < s.size(); i++)
{
a[i] = s[i] - 'A';
}
for (int i = 0; i < s.size() - 2; i++)
{
if (a[i] + a[i + 1] != a[i + 2] && a[i] + a[i + 1] != a[i + 2] + 26)
{
xxx = 0;
break;
}
}
}
if (xxx)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}