I tried to solve a problem in C++, I tried to output the value which class is long double. When I used "%Lf" the output of my solution is -0.000000 on test #1 (it is a wrong answer) but according to my environment, the output is 1.333333 (it is a correct output). On Codeforces, can we use "%Lf" in C++? Or like "%lld", aren't we allowed to use it?
UPD: When I cast it to double, my solution worked.
You can use the Long double. But there are features associated with the compiler. Look at this:
Output of GNU C++:
Output of MV C++:
So you should use the GNU C++ and iostream to display the result.
Yep, the printing of long doubles (in printf/scanf) is broken in MinGW (port of GCC for Microsoft Windows) for who knows how long. The best solution (as you've already worked out) is to convert from long double to double when doing I/O — you don't need that precision when you're just reading or writing numbers anyway.
Thank you!