Source Code
#include<iostream>
#include<string>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<math.h>
#include<map>
using namespace std;

#define LL long long  

int main()
{
	/*
	LL l, r, x, y, k;
	cin >> l >> r >> x >> y >> k;
	LL sum,tsum=0,n;
	for (LL i = l; i <= r; i++)
	{
		sum = 0;
		sum += i * x;
		if (i % k == 0) {
			sum += ((i / k)-1) * y;
		}
		else {
			sum += (i / k) * y;
		}
		tsum = (tsum + sum) % 1000000007;
	}

	cout << tsum;
	*/

    string s;
    int o = 0, k = 0;
    char x[6] = { 't', 'y', 'i', 'l', 'p' , 'c' };
    cin >> s;
    for (size_t i = 0; i < s.length(); i++) {
        s[i] = tolower(s[i]);

    }
    for (size_t i = 0; i < 2; i++) {
        o = s.find('a');
        if (o == -1) {
            cout << "No";
            return 0;
        }
    } 
        for (size_t i = 0; i < s.length(); i++) {
            s[i] = tolower(s[i]);
            if (s[i] == 'a')
            {
                k++;
            }
        }
    if (k < 2) {
        cout << "No";
        return 0;
    }
    for (size_t i = 0; i < 6; i++) {
        k = s.find(x[i]);
        if (k == -1) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";

}
Copy
We Love Atypical Hamza Alali
GNU G++17
0 ms
744 KB
Accepted