Source Code
#include <bits/stdc++.h>
using namespace std;
#define len(s) (int)s.size()
#define all(a) a.begin() , a.end()
#define int  long long
#define endl '\n'
#define MOD 1000000007
int min(int a, int b) { return (a < b) ? a : b; }
int max(int a,int b) { return (a > b) ? a : b; }
void solve() {
    string str;
    cin >> str;
    map<int, int> mp;
    int n = str.size();
    char ch = 'Z';
    for (int i = 0; i < n; i++) {
        mp[str[i]]++;
        ch = min(ch, str[i]);
    }
    for (char c = ch; c < ch + 13; c++) {
//        cout << c << "  " <<mp[c]<<endl;
        if (mp[c] != 1) {
            cout << "No";
            return;
        }
    }
    cout << "Yes";
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
        cout << endl;
    }
}
Copy
Well-indexed? saifomar
GNU G++17
25 ms
768 KB
Wrong Answer