Source Code
#include <bits/stdc++.h>
#define debug(a) cout << #a << ": " << a << "\n"
#define debugLine() cout << "==============\n"
#define tick() cout << "Tick\n";
#define testCases() int t; cin >> t; while(t--)
#define all(a) a.begin(), a.end()
#define fillWith(a, b) memset(a, b, sizeof(a))
#define INF_32 1e9
#define INF_64 1e18
#define Mod 1000000007
#define endl "\n"
#define goFast() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
using namespace std;

string x;

int main()
{
    goFast();
    char arr[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'};
    testCases()
    {
        cin >> x;
        bool can = true;
        for(int i = 0; i < 13; i++)
        {
            int j;
            for(j = 0; j < x.size(); j++)
            {
                if(x[j] == arr[i])
                    break;
            }
            if(j == x.size())
            {
                can = false;
                break;
            }
        }
        if(can)
            cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}
Copy
Well-indexed? AhmadShahal
GNU G++17
3 ms
524 KB
Accepted