In my opinion it would be worth explaining why something is considered a productivity trick at what it does. Plus, prepend std:: in case it's needed, because your readers might not know that std::accumulate is part of the <numeric> header.
A few comments without wanting to be complete here.
In production environment never ever use <bits/stdc++.h>. It will blow the size of your software as it includes whatever, plus it's not portable between different compilers.
No. In 2021 you barely need macros. Start with this.
6.-8. In C++ there is no built-in __builtin_popcount nor __gcd. Some compilers might or might not provide them. But at least std::gcd is provided by the the standard library in <numeric> header.
+1) Productivity trick. Understand what you use and why you use it, that's the only thing that will boost your productivity in the long run.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In my opinion it would be worth explaining why something is considered a productivity trick at what it does. Plus, prepend
std::
in case it's needed, because your readers might not know thatstd::accumulate
is part of the<numeric>
header.A few comments without wanting to be complete here.
In production environment never ever use
<bits/stdc++.h>
. It will blow the size of your software as it includes whatever, plus it's not portable between different compilers.No. In 2021 you barely need macros. Start with this.
6.-8. In C++ there is no built-in
__builtin_popcount
nor__gcd
. Some compilers might or might not provide them. But at leaststd::gcd
is provided by the the standard library in<numeric>
header.+1) Productivity trick. Understand what you use and why you use it, that's the only thing that will boost your productivity in the long run.