Closed mikaelmello closed 5 years ago
What you want to do instead is use cerr instead of cout for logging. It writes values to a different stream which icie can tell apart, so you can have both automated tests and debug messages :)
Clarification about debug/release: all tests run in debug mode so that sanitizer and -D_GLIBCXX_DEBUG can catch bugs(when using exactly-sized std::vector it really is a miracle worker). Release mode is only used in Discover (to speed up slow solutions and test generators) and when selected in manual builds.
Though adding specific flags for each profile is something I wanted to add anyway, as it only really requires adding two new config entries and an if.
What you want to do instead is use cerr instead of cout for logging. It writes values to a different stream which icie can tell apart, so you can have both automated tests and debug messages :)
That is a much better idea, thanks! And it does even work with Codeforces, no more need for #ifdef
then
An ifdef is still necessary - writing to any stream is rather slow and can easily give you TLE if you happen to log too much.
I like to set the
-DDEBUG
flag because of this macro:This way, I can easily debug my code and send the solution without having to remove the debug calls. However, ICIE does not let me submit because, for him, the tests have failed.
I'm not sure if ICIE already uses release builds in order to test the submission (when submitting), but if it does, it would be cool to use different flags.