How can I edit my code if my submission was wrong

I am new here,and was struggling while resulting my solutions.Like if I submit a solution, and it give me wrong answer, is there any way i can edit the previously written code?Every time I open the compiler,all the previous code get erased and one has to rewrite again or have to go to my submission to copy paste the code.
Is there any better option or codechef works this way only?

1 Like

Yes, according to my knowledge, that is the way it works.

You cannot test the code in the editor provided on ‘submit’ page. So I think it is assumed that a user will not normally resubmit the code without testing it on their system first.

I don’t understand, how do your previous code get erase?

Use Codeblocks software where you need to save the code before running!! And as far my knowledge there is no other way to edit your code…!

Might be in Codechef’s compiler you may do that… but not confirmed!

1 Like

Oh! I thought it works like SPOJ, where you can edit your code if compiling goes wrong.Thanks for clarifying .

But what if we have committed some mistake that we realize later or copied some wrong code from codeblocks or if I come up with better logic.

There should be an option to resubmit/edit your code.

Better To use Some online IDEs like ideone and compile and run your codes with specified input cases.The You can just copy and paste the code after clicking on the submit button below whre the problem is present.
Hope this will help u for further coding.
Happy Coding!

Codechef has the ‘My Submissions’ section where all your past submissions(Unsuccessful too!) are listed. Just copy the code you want to edit. Make changes to it in the editor and submit it.

You can use online IDE of codechef itself. It saves our codes too but only the last submitted one.
Even you can select the question and submit from there only if you wan

never use an online ide, if you use it, keep visibility as private

Use codechef’s online IDE.It will save your code. For writing new code and saving the old one, just open a new tab and code on. Otherwise I would suggest you to download a IDE on your desktop like Code::Blocks for C/C++ or Eclipse for Java.That should be better, as you can save templates there for commonly written codes, which increases your speed while implementing as you don’t have to write everything from scratch.

Use to write your codes. I provides immense flexibility even to submit the code directly.

if this happens then go to my submissions copy your code from there and then edit your code accordingly