Best IDE for Competitive Programming?

you can install jupyter notebook / jupyter lab, or you can use vs code with the python and competitive programming plugins installed :slight_smile:

1 Like

ya , i also use this it really nice jdoodle c++

None IDE is best, Depends on our use!

for python-
vs code
-very easy to setup ( 2mins)
-same window run terminal

The better way is to use the following line in code.

#ifndef ONLINE_JUDGE
    clock();
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif

Eg. Following template I use no matter which ide u are using

#include<iostream>
using namespace std;
int32_t main(){
#ifdef _MSC_VER
    _CRT_SECURE_NO_WARNINGS
#endif
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
#pragma warning(suppress: 4101) srand(time(nullptr));
    cout << setprecision(20) << fixed;
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t=0; cin>>t;
    while(t--) {
    }
    return 0;
}
./a.out <input.txt

Taking input from file is working but how to write in output.txt file?? I tried the following but it is showing some garbage value.

/a.out <input.txt >output.txt
1 Like

For easy questions : Less debugging and faster solution ==> Preferred text editor + zsh.
For medium hard questions: More Debugging ==> Clion / Intellij (Best debuggers which I have seen). Provides conditional breakpoints, custom code execution at a particular point.

P.S. Debugging is possible with terminal as well, but never got enough motivation to learn it.

I use VS code with I/O text files on the right and copy paste the test cases in input file. But it doesn’t show the runtime errors. Do I need to setup other things? I would be thankful if someone can help.

1 Like

This is a huge help thanks!

People may not believe but me and my friends still use DevCpp for C/C++ for Competitive programming with ofcourse our setups personalized to meet our uses.
It’s so light weight and incredibly fast IDE!:wink:

i use nvim with g+±8

for C and C++
I personally use Code Blocks IDE and find it very comfortable and easy to use.
I have only one cpp file and I solve all the competitive problems in that.
for JAVA
Try Eclipse IDE

In Sublime I have found one issue that Some times it get freeze while compiling and doesnot show output in output file .Could you please suggest me what could be possible reason.Thanks

Go for Pycharm it is the best for python.

1 Like

Sublime Text :heart_eyes: :100:

I’ve tried so many other text editors, but sublime is the simplest and the fastest.

I call it the simplest & fastest because I didn’t like Vim (steep learning curve).

1 Like

This is a case I have also faced. If the code has segmentation faults or infinite loop or recursions the code doesn’t end itself. Then what I do is goto system monitor and check which programme is consuming most cpu and then kill that process then debug the code again and repeat

1 Like

Just hitting ctrl+c should stop the running program, or closing the terminal, shouldn’t it?

Sublime?

VSCODE any day.

Better shift to ubuntu (linux ) with #atom as editor
 Best combo!!!

To people who use sublime text does it ever happen that your antivirus fires a false negative towards your program and it shows ‘permission denied’?

I have kaspersky and it tends to block my programs sometimes when I execute them by deleting the cpp file and for a good while I cannot run the same program on the editor thus making me switch to some online IDE :upside_down_face:

1 Like