Are any compiler flags set on the online judge?

Does the online judge have any compiler flags set?

1 Like

This is the updated information regarding flags on the compilers set by online judge as of March 2024.

  • C++ :
O2 - second optimization level,
lm - access to "math.h" library,
fomit-frame-pointer - disallow to store frame pointer in CPU register,
pthread - enable multithreading 
  • C :
O2 - second optimization level,
lm - access to "math.h" library,
fomit-frame-pointer - disallow to store frame pointer in CPU register,
pthread - enable multithreading
  • Rust :
opt-level=2 - second optimization level

Runtime Flags

  • Java :
Xss64m
  • ** PyPy 3 :**
OO
5 Likes

Here is more complete answer - What are the compiler options that the judge uses? - faq - CodeChef Discuss

Previous part is from FAQ - FAQ | CodeChef

2 Likes

Is ONLINE_JUDGE actually set properly?

Please look at this question for an example.

Thanks.

You can check yourself, for example by throwing exception if not set :wink: If there is flag missing, please write an e-mail to bugs@codechef.com

I did check and it is ALSO being set for the IDE (which is not what we want).

Sent email to bugs. Thanks.

Also, we can use #ifdef instead, right ?

Rust code is not being compiled with -O as claimed, and this is slowing down Rust submissions dramatically, making Rust unusable for many problems. :frowning:

See Bug report: Rust code is being compiled in debug mode without optimization for reproducible proof. I’ve gotten no response yet from my report to bugs@. (Edit: Actually I got a reasonably quick “we’ll look into this” response that landed in my spam folder, but that’s all so far.)

2 Likes