A. Another Sanity Check, Why Not?
Idea: FazeCT
First, you have to check if $$$n$$$ is in one of the following 3 ranges: $$$48 \le n \le 57$$$, $$$65 \le n \le 90$$$, $$$97 \le n \le 122$$$.
If no, then output "Lmao".
Else, use char() to output the character associated with the number $$$n$$$.
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n; cin >> n;
if(n<48 || (n>57 && n<65) || (n>90 && n<97) || n>122) cout << "Lmao" << endl;
else cout << char(n) << endl;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}
B. Seghhhhhhhhh
Idea: Onirique
If the length of the given string s is odd, then the answer is $$$NO$$$, since adding two strings cannot do that. Otherwise, let $$$n$$$ be the length of the string. Let's go through the first half of the string, comparing whether its first and $$$\frac{n}{2} + 1$$$ characters are equal, its second and $$$\frac{n}{2} + 2$$$ characters are equal, and so on. If the characters in any pair are not equal, the answer is $$$NO$$$, otherwise — $$$YES$$$.
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for(int tc=0;tc<t;tc++) {
string s;
cin >> s;
bool ok = true;
if (s.length() % 2 == 0) {
for(int i=0;i<s.length()/2;i++)
if (s[i] != s[i + s.length() / 2])
ok = false;
} else
ok = false;
cout << (ok ? "YES" : "NO") << endl;
}
}



