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 (28≤a<2162^8 \leq a < 2^{16}).

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

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

Output

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

Author: oh_word

254 characters (haskell)

Previous submissions

#
Submission ID
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] (2≤A<215,1≤B<215,215≤C<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 ABmod  CA^B \mod C. This can be done by stopping the outermost unpickler evaluation with ABmod  CA^B \mod C on the top of the stack.

Author: quasar098

0 bytes

Previous submissions

#
Submission ID
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 (10≤a≤99910 \leq a \leq 999).

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

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

Output

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

Author: oh_word

0 bytes

Previous submissions

#
Submission ID
Status
Score
Time