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

×

PRPALIN 14

In November long challenge contest there is a question "Let us construct palindrome".I have solve it.and i got 35 points for subtask-1.In subtastk-2 the first four task getting wrong and last two task is correct .But in my other code first four were correct and last two were getting RE. So can any one help me what will be the test cases for which i am getting wrong answer in first four task.I cannot paste the solution here because it is a running contest.I also want to know that if length of string is 2 then it will always give answer YES as string of length 1 is always palindrome ?. thanks in advance.Please help me so that i can get 100 points. I have gone through the problem and test case of subtask is not given.But constraints says that sum of length of string over all test cases won't exceed 10^6.Here i would kike to know that if before the test cases completed,and if sum of length of string exceeds its limit then should i break the while loop or not???.please someone help me at this point

asked 14 Nov '14, 18:06

nitya's gravatar image

2★nitya
1014926
accept rate: 0%

edited 14 Nov '14, 18:23

can any one give me a test case where my code may fail.please supply me a test case...thanks

(15 Nov '14, 19:51) nitya2★

My initial solution was something like yours.. Solved subtask1 and last two files of subtask 2. I got to know where I was going wrong. Just keep trying with different test cases. If you are going with a comparison of first and last elements approach, make it equally on both sides after deleting a character. That's what I could say.

Yes string of length 2 will always give yes.

You need not worry about that constraint. It would never exceed that given limit.

link

answered 15 Nov '14, 01:21

vinayawsm's gravatar image

4★vinayawsm
1.9k21430
accept rate: 24%

@vinayawsm what it means make eqauly on both sides..??

(15 Nov '14, 18:39) nitya2★

I'm also facing the same problem.

link

answered 14 Nov '14, 18:16

ar56's gravatar image

3★ar56
-32
accept rate: 0%

Hi nitya, As per your description,if you read the question carefully,100 pts are waiting for you .I had the same problem,but i cleverly managed to get 100 pts. As the contest is live,i cannot comment further :)

link

answered 14 Nov '14, 18:28

asif_mak's gravatar image

1★asif_mak
7041611
accept rate: 19%

will string of length 2 always give yes???

(15 Nov '14, 00:46) nitya2★

String of length 2 is a yes.

link

answered 15 Nov '14, 01:15

horrorsumit's gravatar image

3★horrorsumit
1
accept rate: 0%

string of length 2 will always give yes !

link

answered 15 Nov '14, 02:03

newts's gravatar image

3★newts
251
accept rate: 0%

All i will say is if this is the case for u.. u are just at the threshold of getting 100.. look at both your solutions carefully.. u will get to know what u r missing :) And u need not break the loop, the inputs are given such that it never crosses 10^6

link

answered 15 Nov '14, 02:04

shiv93's gravatar image

3★shiv93
113
accept rate: 0%

@nitya follow what @vinayawsm has said you will get 100....!!!

link

answered 15 Nov '14, 20:03

panther527's gravatar image

1★panther527
41138
accept rate: 33%

1

finally got 100 points ...after 25 submissons...

(15 Nov '14, 20:51) nitya2★
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:

×422

question asked: 14 Nov '14, 18:06

question was seen: 1,132 times

last updated: 15 Nov '14, 20:51