string bydlocode for int qq qq 26 qq string bydlocode bydlocode bool o

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
string bydlocode = "a";
for (int qq = 0; qq < 26; ++qq) {
string a = bydlocode;
bydlocode[0]++;
bool ok = false;
for (int i = 0; i < s.size(); ++i) {
int q = a.size() - 1;
a.push_back(a[q] + (s[i] == '=' ? 0 : s[i] == '>' ? - 1 : 1));
}
set<char> OMG_WHAT_ARE_YOU_DOING;
for (int i = 0; i < a.size(); ++i) {
OMG_WHAT_ARE_YOU_DOING.insert(a[i]);
if (!islower(a[i]))
ok = true;
}
if (ok || OMG_WHAT_ARE_YOU_DOING.size() > n || n > 26)
continue;
cout << a << endl;
return 0;
}