logo

b01lers CTF

Polyglot

Write a polyglot that compiles / runs in as many of the following languages as possible:

Code

1[bash, zig, C, elixir, erlang, fish, golfscript, haskell, J, java, julia, lua, odin, perl, python 0, scheme, rust, typescript, whitespace]

(for exact versions / compilers / docker images, a sample runner is attached below). In each language, the program should:

Input

The first line contains aa (28a<2162^8 \leq a < 2^{16}).

The second line contains bb (26b<282^6 \leq b < 2^8).

The third line contains cc (210c<2122^{10} \leq c < 2^{12}).

Output

Output a single integer equal to abmodca^b \mod c.

Author: oh_word

254 characters (haskell)

Previous submissions

#
Submission ID
Length
Status
Score
Time

Pickelang

pickelang is an esolang that uses the stack-based pickle virtual machine for evaluation; turing completeness is achieved by recursive pickle functionality using the BINPERSID opcode, add, and getitem functions (a sample runner is attached below).

Submit the shortest pickelang payload that passes 5 test cases specified below (100s timeout, 100MB memory limit).

struct.pack and struct.unpack are given for convenience.

Input

The input is a single string in the format [A, B, C] (2A<215,1B<215,215C<2162 \leq A < 2^{15}, 1 \leq B < 2^{15}, 2^{15} \leq C < 2^{16}) and can be retrieved using the input function.

Output

Output a single integer equal to ABmodCA^B \mod C. This can be done by stopping the outermost unpickler evaluation with ABmodCA^B \mod C on the top of the stack.

Author: quasar098

0 bytes

Previous submissions

#
Submission ID
Length
Status
Score
Time

Brainfuck golf

Write the shortest Brainfuck program that computes powmod as specified (a sample runner is attached below).

Note: You are in charge of converting strings to ints and ints to strings. Don’t be lazy now.

Input

The first line contains aa (10a99910 \leq a \leq 999).

The second line contains bb (50b10050 \leq b \leq 100).

The third line contains cc (100c999100 \leq c \leq 999).

Output

Output a single integer equal to abmodca^b \mod c.

Author: oh_word

0 bytes

Previous submissions

#
Submission ID
Length
Status
Score
Time