|
|
вернуться в форумMemory Limit Exceeded, Test15 My code in python 3.6: def is_palindrom(x): if x==x[::-1]: return True return False s=input() s=s[::-1] n=len(s) a=[] for x in range(2,n+1): for i in range(0,n-x+1): if is_palindrom(s[i:i+x]): a.append(s[i:i+x]) if len(a)==0: b=s[-1] else: b=a[-1] print(b) Memory is 70160 Kb, where so much it? Please, help, I would be grateful! Re: Memory Limit Exceeded, Test15 I see you AC now What was the issue? Re: Memory Limit Exceeded, Test15 Oh, sorry, it is other task Re: Memory Limit Exceeded, Test15 |
|
|