FAST_BF2 - The BrainFast Processing! Challenge version

Warning: Only Brainf**k language is allowed.

After I solve this problem in 0.00s using BF , I have an idea to set new BF problems, now here I come Wink

The task is simple, given a <string>(1≤"length of string"≤10) just check if the string is palindrome or not.

The string contains character in range ASCII(97)≤char≤ASCII(122) (lower case alphabet)

Input

The first line, there is an integer T(1≤T≤100) denoting number of test cases then you should process only next T lines, each line is a <string> terminated by new line character ('\n') ASCII(10)

Output

For each test case:

if <string> is palindrome, output: YES

else, output: NO

Example

Input:
2
aba
ab
Output:
YES
NO

Score

Score is length of your source.

If you TLE here, you may try this problem first. If you got AC in 0.00s there you shoud got AC in 0.00s here too Wink

See also: Another problem added by Tjandra Satria Gunawan


Added by:Tjandra Satria Gunawan
Date:2013-01-10
Time limit:0.100s
Source limit:1500B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:BF
Resource:The Mirror of Galadriel Problem plus my own idea ;-)

hide comments
2014-07-06 18:38:07 Sandeep Garhwar
(comment deleted)

Last edit: 2014-07-15 19:31:40
2013-10-19 05:44:29 Mitch Schwartz
@Ali Kanaan: Your name does not appear on http://www.spoj.com/ranks/AMR12D/lang=BF , so your comment makes little sense.
2013-10-19 02:18:55 Ali Kanaan
Hello Tjandra, seems to be challenging, but you mentioned that in case of solving AMR12D as optimal this one should pass.

may you chaeck it please :(
waiting for answers !!!!
thnx;
2013-01-25 20:31:18 Mostafa 36a2
Thank you :)
now i should try to beat Mitch someway :D

Edit : @Tjandra Satria Gunawan, can you increase the time limit a little bit ? maybe 0.01 or 0.02 because of server instability , same code get TLE then AC !
what do you think ? 0.02 is OK i think :)

Last edit: 2013-01-26 19:08:25
2013-01-25 13:44:28 (Tjandra Satria Gunawan)(曾毅昆)
@Mostafa 36a2: Congratulations :-D
2013-01-25 12:28:21 Mostafa 36a2
Yes :)finally accepted ...
thanks GOD
thank you @Tjandra Satria Gunawan for the problem ,that's not my best yet :)
thanks
2013-01-24 15:57:54 Mostafa 36a2
Ans:@Tjandra Satria Gunawan,wow, just 11 oh my GOD i think it passes 50 :(
i'm improving my mind now..
actually This is The Hardest BF problem i ever solved(i meant not solve :D ), thanks ;)

Last edit: 2013-01-24 21:09:37
2013-01-23 14:48:41 (Tjandra Satria Gunawan)(曾毅昆)
Info: @Mostafa 36a2: now your code seems right, but you only solve 11 of 100 cases (TLE)...

Last edit: 2013-01-23 14:48:53
2013-01-18 06:12:38 Mostafa 36a2
haha :) ,i know that my code fail when the first half of the word is permutation of the second half o_O :D
so yoyo will fail my code also 123132 and so on,
its work on The Mirror of Galadriel ,
but here not work :)
any way , maybe another chance to think outside box :D
2013-01-17 17:07:25 Mitch Schwartz
Heh, there's still an issue. My 144 code is definitely incorrect, it should be 155. I'm PMing you about it.

Ans: Now I know what do you mean, after testing your code on my computer... Now I added some case that your 144B and 154B code give wrong ans... Thanks for pointing that out ;-)

Last edit: 2013-01-17 17:23:52
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.