#P6312. [PA 2018] Palindrom
[PA 2018] Palindrom
Problem Description
Translated from PA 2018 Round 3 Palindrom.
Please pay special attention to the memory limit of this problem.
Given a string, determine whether it is a palindrome.
A palindrome is a string that reads exactly the same from left to right as from right to left.
Input Format
The first line contains an integer . In some testdata it represents the length of the string, and in some testdata (which means the length is not given).
The second line contains a string, which is the string to be checked.
Output Format
If it is a palindrome, output TAK; otherwise output NIE.
5
kajak
TAK
0
kanu
NIE
Hint
Constraints
This problem uses bundled tests.
For of the testdata, the length of the string does not exceed .
You may assume that in any testdata, either or .
Thanks to
Translated by ChatGPT 5