In C/C++, how should I read/write long longs?

How can i write long longs in C/C++?

1 Like

Some compilers, such as Dev-C++, require you to use %I64d with scanf/printf. However, for your code to work on Codechef, use %lld instead.

1 Like

Or simply use cout.

Along with the line std::ios_base::sync_with_stdio(false); at the beginning of main to speed up cout/cin

1 Like