So I was just scrolling the leaderboard and opening random solutions, just when I came upon a code submitted by tourist and the code contained the time of creation of code.
I guess it is dynamically generated, can someone tell me how it is done?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
So I was just scrolling the leaderboard and opening random solutions, just when I came upon a code submitted by tourist and the code contained the time of creation of code.
I guess it is dynamically generated, can someone tell me how it is done?
Name |
---|
Auto comment: topic has been updated by divyansh_0602 (previous revision, new revision, compare).
I don't think it's a boilerplate code. If you see in his streams, he has a pretty simple setup in which the above comments are previously written (before the actual streams). That means, He probably is writing the time of creation of the file manually.
During ongoing contests, I think no one has that much free time to write this specially if you are tourist XD.
Yup that's true, That's why I said before streams! He starts the contest after the streams gets live. This is true for virtual contests. However, I guess no one except him has an idea about how he does stuff like that when he does ongoing contests.
Oh I see, yeah maybe he starts the contest with 7-8 files saved beforehand XD. Anyway who knows he uses uses another program to generate a cpp file with boilerplate code first, and then edits the cpp file.
He uses the Far Manager editor with some script. I don't know how does it work there, but he definitely doesn't write it manually. Similar thing can be done in linux using Vim editor and UltiSnips: https://github.com/SirVer/ultisnips. It works like when you write some key word, for example "temp" for template and press Tab key, it autocompletes everything you want. If you want to see an example, here you can find my UltiSnips config files for both python and cpp: https://github.com/violistt/dotfiles/tree/main/vim/UltiSnips. It's basically linux time formating. If you want to use different time format, here you can find all possible options: https://man7.org/linux/man-pages/man1/time.1.html.
Thanks a lot man!