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

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

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

Hello Everyone,

In my template I use macros like #define ll long long int and many others.

But I found on web that it takes more memory and it is wise to use typedef long long int ll or using ll=long long int
I am confused. Which will be efficient for time as well as memory. Please help me. Thanks in advance.

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

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

Here somebody wrote a useful comment.

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

They're both wrong, use #define int long long

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

Not a lot of people outside China know this, but there is actually a very simple trick you can use to speed up your code. To use it just simply write

#define int64_t bool

And now all your long longs are booleans, and you can put them in a bitset. Good luck!