Java class sandbox with instrumentation support for online judges.
It implements:
- a much faster, unsynchronized ASCII-only
System.out
stream that's suitable for single-threaded online-judging scenarios - support for disallowing particular classes from being loaded, to force certain solutions trivialized by the standard library
- optional unbuffering of standard output, for interactive problems without requiring users to flush manually
- logging of exceptional exits to a state file
To run a class Submission
with agent the following suffices:
$ java -client -javaagent:/code/java-sandbox-agent.jar=[option, ...] Submission
Supported fields for the option
list are:
nobigmath
— disablesBigInteger
andBigDecimal
, raising appropriate exceptions if they are usedunicode
— encodesSystem.out
as UTF-8 instead of ASCII, sacrificing performance for Unicode supportnobuf
— setsSystem.out
as being line-buffered, for interactive problemsunsafe
— enablessun.misc.Unsafe
, which is disabled by default