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

using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--) {
		string s, ss = "ABCDEFGHIJKLM";
		cin >> s;
		sort(s.begin(), s.end());
		if (s == ss) {
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
	}

	return 0;
}
Copy
Well-indexed? Malek_Alian
GNU G++17
54 ms
580 KB
Accepted