Блог пользователя shoya

Автор shoya, история, 5 лет назад, По-английски

Which IDE/Editor do you use and what do you like about it? How do you test for sample tests of the problem fast? Do you use terminal during contest? Also how do you debug your code during contest? Do you use IDE Debugger or debug manually?

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится -9 Проголосовать: не нравится

Usually, I write my code on Sublime text (it has some interesting features), then run it on a local IDE (Code::Blocks for C++), or an online IDE(like C++ shell, but it's not really practical, since you can't copy/paste input from contest to IDE). I still use this method during contests that take place on other platforms.However, onn CodeForces, I use the Custom Test machine that is provided in the contest. Actually, it is pretty fine, and even if it's not as visually comfortable as Sublime Text, it is good, and, being an IDE, it avoids me some drawbacks of Sublime Text which is just an Editor. It's also pretty fast, compared to other online IDEs such as CodeChef's and AtCoder's (Based on personnal experience). Moral of the story, I advise using the Custom Test of CodeForces. If you don't like it, I advise downloading Sublime Text and/or an IDE to compile and run your code. I hoped my advice was helpful. Happy coding!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Why don't you run you code on Sublime text only, I compile and test it on sublime itself.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    I think the Custom Invocation will be slow due to server load during a contest.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      I used Custom Invocation regularly. At the beginning of a contest, you will have a hard time using Custom Invocation. I use Ideone when it is slow. After 20 — 30 mins you will have a faster Custom Invocation. In fact, recently Custom Invocation is decently fast from the very start of a contest.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use only SublimeText on Linux. Before switching I was on Code::Blocks and Windows. Major drawback on previous setup for me was: you couldn't compile/run another code before closing cmd. It isn't issue for me now (and compilation on linux is faster)

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

Before : Windows + Code::Blocks + Hightail

Currently : Linux + Sublime text 3 + (Hightail || Sublime Input method as a comment)

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I write code in Dev c++ and run it on hackerrank

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use VIM with some modifications so that F5 is compile and run. That way I barely need to exit to type commands in the terminal (I can never remember them).

Also wrote a script to open vim and all the relevant input files so I don't have to do it myself.

For sample test I just paste it to a text file and run the program (you can use preprocessor stuff so that your code reads in input from some text file).

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Can you share your .vimrc please?

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      It is very messy.

      But I basically copied and paste stuff from wherever I can find.

      The thing I was talking about is on line 91:

      map <F5> :<C-U>!g++ -Wall -Wextra -Wshadow -fsanitize=undefined -DLOCAL -O -std=c++17 % -o %:r && ./%:r <CR>
      

      This should let you compile and run C++17 files in Vim if you do F5 (with the LOCAL tag, you can also make a version without -DLOCAL). I didn't write this code, netman has it on here.

  • »
    »
    5 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    Did you switch from IDE to vim or you borned with vim? :(

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      I was scared of Vim (before I was using Sublime Text). But I decided to switch and now it's feeling more natural.

      • »
        »
        »
        »
        5 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        I don't like the fact that the cursor fills all of the word that we are in and also that we cannot move faster like I cannot go 30 lines fast ( Maybe there is fast method in vim)

        • »
          »
          »
          »
          »
          5 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          Do you mean ctl-D and ctrl-U? Vim is very capable of doing anything you can think of (with the right setup), you just have to search for it.

          • »
            »
            »
            »
            »
            »
            5 лет назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            sorry for a lot of questions bro.

            how did you install vim i do apt-get install vim but it says that it has independent packages and i also checked the file that I have the links to servers and changed them several times and I still cannot change it do you know why ( I have searched in google and tried all of the solutions on stack overflow)

»
5 лет назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

sublime text and copy pasting test cases and manually writing compilation command to terminal

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    This also gives you a lot of flexibility, you can stop compilation, stop running the code, and even clean up leftover files when program terminates abruptly. Another benefit is, switching to output redirection(>) into files is really easy, which can help with checking large outputs.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      Exactly! Redirect file input output from standard IO exe is also really easy and nice. Only downside is sometimes I end up copy pasting some code into the terminal instead of the test cases and suddenly like 50 junk files show up in the directory. (Actually I still haven’t found a satisfactory way to resolve this yet.)

»
5 лет назад, # |
  Проголосовать: нравится -14 Проголосовать: не нравится

Geeks for Geeks IDE...code and run online :)

»
5 лет назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

personally i like codeforces IDE ,here i can copy sample test and run it there , which is comfortable and saves time .

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use devc++ to write and compile my code.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For Java, you could go with IntelliJ Idea(or Eclipse). IntelliJ has many good features for development too. Infact, I personally find it's debugger very useful. Besides, you can get all the Jetbrains product for free on a Student ID.

»
5 лет назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится

I used to write code in Eclipse few years ago. I could install it for Windows and use it in World Finals. I'm not using Windows anymore neither Eclipse (it was total crap btw).

I started using vim, but it's not very easy, and for sure you will need several plugins and customization before feeling comfortable. Personally I found vimrc from misof very useful, and is the core of my current vimrc ( https://people.ksp.sk/~misof/programy/vimrc.html ). Note that I don't use vim for competitive programming anymore, but I use it for a lot of other things.

Then I start writing code on Sublime. Sublime is blazing fast and was all I needed in my slow computer to write code for competitive programming. It has very basic features, but if you feel comfortable writing code in your language, it is ok.

Finally I think vscode is my goto editor for competitive programming. It is very fast (not as fast as Sublime though) but has greater community and much more useful extensions and tooling.

I started to develop an extension for vscode to write code in competitive programming. You can install it from the marketplace. It is called acmX.

You can see a brief example of how to use it here: https://youtu.be/ouCU9xyW1i8

I created this Telegram group for the extension https://t.me/joinchat/FksZ0BSkGh7anvpFYisjMw.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Sublime text 3 and Ubuntu terminal with auto-complete disabled in Sublime because it just adds std:: to everything during auto complete. I use the following aliases for running code.

Aliases

Here 00.cpp is my skeleton/template code for contest which consists of only 3 lines.

Apart from that I use my personal compiled bits/stdc++.h so that my C++ code compiles in blink of an eye because compiling original bits/stdc++.h still takes few more milliseconds even if pre-compiled for which I wrote a script before.

»
5 лет назад, # |
  Проголосовать: нравится -6 Проголосовать: не нравится

I write code in the Submit Code tab and press submit to compile. The samples are tested automatically by the tester.

»
5 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I use far manager. It doesn't have that much special features except you can boast about tourist using it

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use ideone, obviously the most superior ide. ;)

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use CLion on Mac.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I'll recommend u SUBLIME TEXT 3 , its the fastest text editor, with some great features of Snippets and auto-completions.It has separate input and output file system .it has great interface with DARK mode.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Since nobody mention cf-tool I do.

It is a great command line tool to download problems and whole contests with all testdata to the local system, compile/test/run and submit.

It perfectly fits to be used with vim as an editor.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

use cp-editor ultra-fast and easy to use. CP-editor

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I use sublime text combined with xalanq's very useful cf-tool. Sublime for editing code, cf-tool for debugging and running locally.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

I created a plugin for this purpose. https://github.com/suraj-2306/cc_vim.git It opens up an input.txt and an output.txt along with the main .cpp file, in a split-screen config. By hitting F9, you can compile the code and execute it. The expected output is shown in the output.txt buffer while taking input from the input.txt buffer. It uses a custom makefile for compilation and execution of the code. It's pretty helpful if you're starting with cc in vim.ATB

»
4 года назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

I had to reinstall my setup recently so here's exactly how I have it:

install sublime

install some c++ compiler

change sublime compilation flags to use C++17 -O2 and some other compilation flags like -Wshadow

code with sublime, compile with ctrl+B, run on command line

So yeah, not much is needed.

»
4 года назад, # |
Rev. 5   Проголосовать: нравится 0 Проголосовать: не нравится

CLion with JHelper.

--

Advantages: I have competitive companion, which parses the test input/output and sends it to JHelper. It's nice I don't have to copy paste the input and so on.

CLion has a bunch of useful stuff. It has a debugger, but I don't use it that much >.< ... it also has a bunch of other features I don't know how to use :P

--

I don't use terminal, although I used to use alacritty + vim.

»
4 года назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

VScode forever.

»
4 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Far manager