Source Code
#include<bits/stdc++.h>
#define ll long long
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;


int main(){

FAST;
int t;cin >>t ;
string s="ABCDEFGHIJKLM";
while(t--){
    string s1;cin>>s1;
    sort(s1.begin(),s1.end());
    if(s==s1)
        cout<<"YES"<<endl;
    else
        cout <<"NO"<<endl;
}
}
Copy
Well-indexed? midoelkhaitb
GNU G++17
66 ms
316 KB
Accepted