Description
Alice and Bob live on a unique planet: it is neither flat nor spherical—it is a cube! They want to optimize their wired connection on the surface to minimize the latency of their communications.
The cube has dimensions of 32×32×32, and the format of the points where Alice and Bob live is like [0,2,14]
or [32,28,11]
.
We can see that these points are located on the surface of their planet.
To minimize wired communication, Alice and Bob need to find the shortest surface distance between a series of point pairs. To simplify calculations and keep only integer values, the goal is to compute the square of the shortest path distance (on the surface) between each pair of points.
Using the previous example, the expected minimum surface path distance between [0,2,14]
and [32,28,11]
would be 3789.
This path passes through the point [13,0,0]
.
Note: The provided file, un-cercle-est-un-carre.py
, contains the server-side code that handles the service.
We do not provide the file minimum_distance.py
.
This file is referenced because it is used to check your answers: your objective is to write the function minimumDistanceOnCube
.
Files
- docker-compose.yml
-
un-cercle-est-un-carre.py
2.00 KiB – cdadadab30f78ddf31b4f9798a201adda063648d9accbecb1fdab6a703a9fa93
Author

Challenge Instructions
- First, download docker-compose.yml:
curl https://hackropole.fr/challenges/fcsc2025-misc-un-cercle-est-un-carre/docker-compose.public.yml -o docker-compose.yml
- Launch the challenge by executing in the same folder:
docker compose up
- Then, in another console, access the challenge with Netcat:
nc localhost 4000
In case you encounter problems, please consult the FAQ.
Flag
Submit your solution
You can submit your writeup for this challenge. Read the FAQ to learn how to proceed.
You need to be logged in to submit a writeup.
Writeups
There are no public solutions for this challenge yet, but you can submit yours after getting the flag.