Source Code
#include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define pf push_front
#define eb emplace_back
#define rep(i, b, n) for(int i=b; i < n ; i++)
#define rev(i, n, b) for(int i = n; i>= b; i--)
#define ll long long
#define F first
#define S second
#define endl "\n"
#define int ll
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define ali "Alice."
#define bob "Bob."
#define OO 0x3f3f3f3f3f3f3f3f
int dx[] = {+0, +0, -1, +1, +1, +1, -1, -1};
int dy[] = {-1, +1, +0, +0, +1, -1, +1, -1};
int kdx[] = {2, 1, -1, -2, -2, -1, 1, 2};
int kdy[] = {1, 2, 2, 1, -1, -2, -2, -1};
const double Pi = 3.14159265358979323846264;

bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
    return a.second > b.second;
}

const int mod = 1e9 + 7, N = 1e5;

void solve() {
    string s;
    cin >> s;
    map<char, char> m;
    for (auto i: s) m[i]++;
    string ans = "typical", ans2 = "TYPICAL";
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'a' or s[i] == 'A') {
            int pos = 0;
            int cnt(0);
            for (int j = i + 1; j < s.size(); j++) {
                if (s[j] != ans[pos] and s[j] != ans2[pos]) break;
                cnt++;
                pos++;
            }
            if (cnt == 7) {
                yes;
                return;
            }
        }
    }
    no;

}


signed main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifdef Clion
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t(1);
//    cin >> t;
    for (int i = 1; i <= t; i++) {
//        cout << "Case #" << i << ":"<< endl;
        solve();
    }
}
Copy
We Love Atypical Mnesy
GNU G++17
1 ms
256 KB
Wrong Answer