bansalarpan4's blog

By bansalarpan4, history, 5 weeks ago, In English

hlo , i m new to competitive programming . i have seen many pro competitive coders using sublime text (with input.txt , output.txt and error.txt files ) as in https://www.youtube.com/watch?v=r-ZoM2ex-uk&list=PLAj_13N2fk-SkD-A1cDAs-QpHGQcdnzoB&index=4

this setup really looks nice and useful does anyone know the steps to be taken o any tutorial for this set up ??

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it +2 Vote: I do not like it
Spoiler
»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

you can easily find many videos on youtube and google. post wasn't needed , if you have any issues in setup which couldn't be solved then you should have created the blog

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

just make 2 files = inputf.in , outputf.in and main file to write code then in build system paste { "cmd" : ["g++ -std=c++17 $file_name -o $file_base_name && timeout 4s ./$file_base_name<inputf.in>outputf.in"], "selector" : "source.c", "shell":true, "working_dir" : "$file_path" }

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

does anyone know what this line of code mean and how is this useful for competitive programming

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's a random number generater, constructed with seed chrono::steady_clock::now().time_since_epoch().count() . Random numbers are needed when we want to hash a string, and we need a seed changing rapidly by time to ensure it's randomness, otherwise the hash method can be easily hacked, just as what I'm doing these days on problem 1984D.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Is it a thing like for particular problems or just in general to prevent hacking? I don't know much I m a newbie

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I think it's just used in string suffix structure problems, and is only useful in this kind of problem to prevent hacking. But you may see this in other problems' codes because some people just write this into their templates.

»
5 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

I used this to configure it (for Linux, but is similar to Windows). As a build system I use this:

Linux
»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Use Notepad++ and all your problems will go away...