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.
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
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.
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
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.