Codeforces 691B s-palindrome

时间:2023-03-08 17:39:42

水题。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi = acos(-1.0), eps = 1e-;
void File()
{
freopen("D:\\in.txt", "r", stdin);
freopen("D:\\out.txt", "w", stdout);
}
inline int read()
{
char c = getchar(); while (!isdigit(c)) c = getchar();
int x = ;
while (isdigit(c)) { x = x * + c - ''; c = getchar(); }
return x;
} char s[];
int f[][]; void init()
{
f['A']['A']=; f['b']['d']=; f['d']['b']=; f['H']['H']=;
f['I']['I']=; f['M']['M']=; f['O']['O']=; f['o']['o']=;
f['p']['q']=; f['q']['p']=; f['T']['T']=; f['U']['U']=;
f['V']['V']=; f['v']['v']=; f['W']['W']=; f['w']['w']=;
f['X']['X']=; f['x']['x']=; f['Y']['Y']=;
} int main()
{
memset(f,,sizeof f); init();
scanf("%s",s); bool fail=;
int len=strlen(s);
for(int i=;i<=len/;i++) if(f[s[i]][s[len-i-]]==) fail=;
if(fail) printf("NIE\n"); else printf("TAK\n");
return ;
}