Uploaded files from CCC 2026 42nd #Classic with our team solutions and test data.
In a cleanroom so clean that even the dust must wear a hairnet, Dr. Γ ngstrΓΆm has just switched on FAB-42, the world's first nanofabricator. It doesn't print, carve or mill anything. It creates matter with laser light, one hexagonal cell at a time.
Six laser emitters ride on a rail around a hexagonal board. On every tick each emitter moves forward (F), moves back (B), toggles its laser (T) or waits (-). A cell hit by exactly two beams becomes matter, and three or more beams destroy it. When the whole pattern stands in its exact place with nothing touching it, the pick-up arm collects it.
Two of our real level 6 programs, replayed tick by tick. Left: a 36-cell pattern is built up over five ticks and collected 5 times in 27 lines. Right: three setup ticks yield the first copy on tick 3. From then on five lasers stay in place; triple crossings erase every cell that would touch the pattern, so FAB-42 rebuilds and collects it on every tick, 17 times in 19 lines.
We solved all 6 levels and finished with:
- π₯ Local Moldova (UTM): 1st place
- π Global: 14th place
- β‘ Level 6 (optimization): 14,566 program lines in total, lower is better
| Input | Patterns | Board radius | Lines | Lines per pattern |
|---|---|---|---|---|
2-medium |
210 | 3β5 | 5,806 | 27.6 |
3-large |
190 | 6β8 | 4,664 | 24.5 |
4-enormous |
140 | 9β12 | 4,096 | 29.3 |
| Total | 540 | 14,566 | 27.0 |
| Level | FAB-42 says | Task |
|---|---|---|
| 1 | software ...... NOT FOUND |
Print the hexagonal board for each radius |
| 2 | emitter ....... ARMED |
One emitter: every cell its beam hits becomes matter |
| 3 | beam power .... 50% |
Up to six emitters: two beams create matter, three or more destroy it |
| 4 | RUN? [y/N] |
Run emitter programs (F, B, T, -) tick by tick |
| 5 | pattern ....... LOADED |
Detect finished patterns and count how many get submitted |
| 6 | incoming challenge ... PER TICK |
Optimization: the shortest programs that make each pattern the required number of times |
Levels 1β5 are solved in C++ (level_N/Solution/level_N.cpp). Level 6 lives in level_6/opt/.
Every tick offers 46 = 4,096 possible instruction lines, and a program needs a few dozen of them, so we treated level 6 as a search problem and ran it on both the CPU and the GPU.
- Beam search. A state is the emitter positions, which lasers are on, the matter on the board and the copies collected so far. States are deduplicated on the pattern cells only, which keeps the beam diverse (
bs6s.cpp,bs6p.cpp). - On the GPU. The same search as CUDA kernels compiled at runtime through CuPy, with beam widths up to 131,072 (
gpu6.py,gpu6snap.py). - Tail re-search. Cut the best program part-way through (at fixed fractions of its length, or right after a collection), replay the prefix and search the rest again from that exact state, keeping only strictly shorter endings (
tail6g*.py,tailA.py,post6.cpp). - Closer to the real rules. Let the search rebuild destroyed cells and keep temporary matter next to the pattern, and rerank by a lower bound on the remaining ticks (
gpu6r.py,gpu6a.py,gpu6L.py). - Never lose a gain. Every candidate is checked by an exact simulator, the shortest valid program per pattern is merged (
nano6.py,merge6.py), and a loop submitted every file that beat the board until the final seconds of the contest.
In the first 21 minutes on the board the method changed three times, from a greedy builder to beam search; after that the search only got wider, smarter and more parallel.
| Input | 18:47 (first loop round) | Final | Change |
|---|---|---|---|
2-medium |
6,105 | 5,806 | β299 |
3-large |
5,357 | 4,664 | β693 |
4-enormous |
5,076 | 4,096 | β980 |
| Total | 16,538 | 14,566 | β1,972 (β11.9%) |
Every candidate file from the contest, scored with the exact simulator, is in stats/stats.md; every board change, per input, is in stats/timeline_full.csv.
CCC.zip
βββ level_1 β¦ level_5
β βββ statement.txt
β βββ input/ inputs, example output, statement PDF
β βββ output/ our outputs
β βββ Solution/ final C++ solution
β βββ tried_working/ earlier attempts
βββ level_6
βββ statement.txt
βββ input/ example, small, medium, large, enormous
βββ opt/ solvers, tools, logs and outputs
βββ w_*.out final submitted programs
βββ agents/ extra solvers: CPU tail, heuristic, cycle search, post-optimizer
βββ win_scripts/ merge and auto-submit loop
assets/ README visuals, rendered from our real programs and submit log
stats/ every candidate file scored, full board timeline
unzip CCC.zip cd level_6/opt # validate and score a solution file python3 nano6.py score ../input/in_level-6_2-medium.txt w_2-medium.out # CPU beam search: <in> <out> [W0] [threads] [budget_s] [Wmax] [reverse] g++ -O2 -std=c++17 -pthread bs6s.cpp -o bs6s ./bs6s ../input/in_level-6_3-large.txt large.out 64 8 20 4096 # GPU beam search (NVIDIA GPU + CuPy): <in> <out> <beam width> python3 gpu6.py ../input/in_level-6_4-enormous.txt enormous.out 16384