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

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

I see some very good coders such as snuke, Petr do this. struct Solver and writing their actual solution in the Solver's method void solve(). Is there any practical benefit of doing this?

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

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

They probably get used to code in Java, hence they use OOP/struct in C++.

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

Don't know about them but i personally use this so that in multiple tc's questions i can write

This

Instead of

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

Ability to reset global variables at tasks with multitests

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

One advantage is that order of function defintions doesn't matter. You can use a function defined below your main function inside main function.

Code Example