Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор bansalarpan4, история, 4 месяца назад, По-английски

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

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

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

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

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

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" }

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

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());

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

    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.

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

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

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

        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.

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

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

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

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