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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    string s;
    cin >> s;
    string d = "aacilpty";
    int cnt = 0;
    for(int i = 0 ; i < s.length(); i++){
        s[i] = tolower(s[i]);
    }
    sort(s.begin(), s.end());
    for(int i = 0, j = 0; i< s.length();i++){
        if(s[i] == d[j]){
            j++;
            cnt++;
        }
    }
    if(cnt == 8)
        cout<<"YES";
    else
        cout<<"NO";
   
    return 0;
}
Copy
We Love Atypical Mohamedmaher
GNU G++17
4 ms
960 KB
Accepted