Code Never Runs.

,

i have tried code chef a lot of times but everytime my code fails, either it doesnt run or it gives wrong answer(even though my logic is correct as the code runs on my compiler). I am really frustrated but still after a long time I have come back, but I am facing the same problem as my code never runs on code chef’s compiler but it does on the compiler in my PC.

P.S.:Please HELP…!!

Hey Dude, I had also the same problem that you are having. but I have solved that.
To solve this issue I need to see your code, but eventhough I am giving some tips to you which might be helpful to you.

  1. u need to see which type of runtime error occurs, then go for its solution.
    for ex. if your c code is giving NZEC runtime error then your main method does not have a return 0; statement.
    like these there are also some types of runtime error and its reason here

  2. you should use datatypes for variable as per the input range which is specified in your given problem. because while tesing program they might be entering larger values which may not be properly stored if you have taken short range data types. so be careful while selecting data types also.

/*The question was from august challenge 2013… with code SPCANDY /
/
The code is as follows */

CODE REMOVED BECAUSE IT IS PART OF ONGOING CONTEST

its alright to have removed my code but still, if u get my problem pls provide a solution…

Let us see the code you have written for getting inputs and printing outputs. If you are sure your algorithm is 100% correct then it would have to be how you deal with IO

Can’t tell until contest finishes.

But, you can check here FAQ | CodeChef

PS: First try some practice problems and then solve contest problems.