You are not logged in. Please login at www.codechef.com to post your questions!

×

WA in SPOJ: PLD

Here is this spoj Problem

http://www.spoj.com/problems/PLD/

i am using manacher's algorithm for finding palindromic substring but getting WA, can somebody tell where i am wrong?

Here is link to my code..

http://ideone.com/kiuE9g

asked 22 Jun '13, 23:50

parikshit979's gravatar image

3★parikshit979
74127
accept rate: 0%


Your solutions give wrong answer to almost all the test cases.

example:

input

2 abbaabbacaacfguiuoppo

your output is 0 while correct answer is 5

input

3 abbbaaabbbbaaaaaabbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbb

your output is 10 while correct answer is 65.

input

2 aaaaa

your output is 2 while correct answer is 4.

hope it help to find bug in your program.

enjoy happy coding :)

link

answered 23 Jun '13, 01:03

chandan11111's gravatar image

3★chandan11111
3.6k133555
accept rate: 10%

1

thanks.. after little modification got AC..

(23 Jun '13, 10:10) parikshit9793★

pleasure is mine :)

(23 Jun '13, 10:50) chandan111113★

wat modification can u tell me

link

answered 17 Jan '14, 14:09

blaziken's gravatar image

2★blaziken
29114
accept rate: 0%

change sign == to >= :D

(27 May '14, 16:48) paras8852★

My code gives the correct answer for the all testcases mentionend above but it's still wa :(

my code: http://ideone.com/o2GMTa

What logical mistake did I make?

Thanks in advance! :D

I did not use Manacher's Algorithm, instead I used Rabin Karp.

link

answered 16 Jul '15, 12:53

prantoran's gravatar image

4★prantoran
12
accept rate: 0%

edited 16 Jul '15, 12:55

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×643

question asked: 22 Jun '13, 23:50

question was seen: 5,273 times

last updated: 16 Jul '15, 12:55