← Back to topics
Topic

Z-lastchar

D
Dgleich
How to solve this task, bruteforce with string insertion is to slow?
a
adminModerator
with two lines of code :)
D
Dgleich
Well I don't know that two lines :D , I tryed for about and half an hour and couldn't think of solution :D
A
Al3kSaNdaR
Admin is the bug when we get TLE and it is memory limit exceeded solved ? I'm constantly getting TLE for z-lastchar and I don't know why.

http://www.z-trening.com/new/www/html/submit.php?submit=7100056465&subm_code=1
D
Daniel93
Have you used long long int?
D
Dgleich
Solved Thanks to Amtrix!
Admin, sorry for creating a new topic :(
a
adminModerator
don't apologize, that's what forum is for
m
msantl
Can somebody explain why the solution with 1<<N in code won't work ?
A
Al3kSaNdaR
Bit shifting will only work with integer. Doesn't work with llint !
a
adminModerator
if you write 1, it is considered as int (long)

you can write (long long)1 << N