Source Code
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;

int main() {
	int n;
	cin >> n;
	string indexed = "ABCDEFGHIJKLM";
	while (n--) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		if (s == indexed)
			cout << "YES" << endl;
		else
			cout << "NO\n";
	}
	return 0;
}
Copy
Well-indexed? NoName
GNU G++17
30 ms
516 KB
Accepted