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 November 2017.

  • 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 ````

- **Pascal :**

O2 - second optimization level,
fomit-frame-pointer - disallow to store frame pointer in CPU register````

  • Python :
OO - don't store debug information + don't store docstrings
  • Ada :
O2 - second optimization level,
  • 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
  • Scheme :
O0 - entry optimization level
  • Haskell :
O - first optimization level
  • Pascal :
O2 - second optimization level
  • Common Lisp :
dynamic-space-size 48 - amount of space (in MB) dedicated for startup
disable-debugger - disable debugger
  • C99 :
lm - access to "math.h" library,
fomit-frame-pointer - disallow to store frame pointer in CPU register,
pthread - enable multithreading
  • Javascript Rhino :
Xmx256M - memory limit equal to 256MB
Xms16M - start Java VM with 16MB of memory
  • 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++14 :
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 :
O - first optimization level
  • Python 3 :
OO - don't store debug information + don't store docstrings
2 Likes

Here is more complete answer - http://discuss.codechef.com/questions/3480/what-are-the-compiler-options-that-the-judge-uses

Previous part is from FAQ - http://www.codechef.com/wiki/faq#Are_any_compiler_flags_set_on_the_online_judge

1 Like

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 [email protected]

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 ?