Solution failing for larger String value

c
java
result
subtask
timelimit

#1

Hi All, I am new to codechef . I just don’t understand why case 3 of subtask 1 is failing?

Subtask #1 (30 points)

1 ≤ T, |s| ≤ 10^3 1 ≤ Sum of |s| over all test cases in a single test file ≤ 10^4.

My solution gives out : Sub-Task Task # Score Result (time) 1 1 NA AC(0.000000) 1 2 NA AC(0.000000) 1 3 NA WA(0.000000)

How can I make it work for string greater than 10^3. for c program the max limit is 4095 characters. For java its much larger . I had submitted the solution in both languages but still the subtask 1 task 3 is WA .If solution is working for strings <10^3 then it should work for larger string as well.I don’t understand.Please help me out.


#2

Your solution is not working for Subtask #1, as task 3 of subtask 1 is failing.

Then, why are you asking about the solution that would work for string greater than 10^3.

Your logic may be incorrect.

At First, try to pass the subtask 1 completely.


#3

Please do not create multiple threads on same thing, you can get reported which will make you unable to ask Q until you earn some karma.

I just don't understand why case 3 of subtask 1 is failing?

It means your logic is incorrect or your program isnt printing correct output or is printing in incorrect format.

or c program the max limit is 4095 characters.

You are applying a correct concept at wrong place. Refer here- https://stackoverflow.com/questions/11488616/why-is-max-length-of-c-string-literal-different-from-max-char

In C you can declare char arrays more than 10^6 and store strings in them.


#4

Sorry about multiple threads.It was created by mistake because of slow internet connection. Thanks anyways.