← Back to topics
Topic

Z-palindromes

m
msantl
Why do i get TLE?

http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100042071


m
msantl
Anybody ??
m
msantl
Nevermind, i figured it out
D
Diabolic
Can you tell me what was the problem, please? I also do programming in C++, but seems like in every task when I use string (ex. char a[100]), I get wrong result.
g
gates
for C strings:
if you need N characters then you should allocate at least N+1 bytes of memory.
and cin/cout are from c++, not from c, so you can't read C string with cin ( i think ).
you can read it with
scanf( "%s", a );