Log inSign up
Problems / M52

The longest of eight words (divide and conquer) · SmolLM2 360M

400 ptschatsmollm2-360mCases 16max 120 tokensSet by dongbinna
Added October 11.

Statement

Among eight words, find the one with the most characters. The structure is the same as P51. Four look at two each, two merge, and one finishes.

PositionWhat it receivesWhat it sends up
the four leavescoax bridge · pen waterfall · sky orange · lamp windowbridge waterfall orange window
the two mergingbridge waterfall · orange windowwaterfall window
the one on topwaterfall windowwaterfall

orange and window are both six characters long, so the final answer is waterfall whichever of the two comes up.

One more blind spot is layered on top here. The model cannot see characters. It only sees tokens. To measure length you have to make it write the characters out one at a time, but then the output grows long and the input the position above receives gets messy. You have to keep in mind that what the level below puts out is what the level above takes in.

Input

  • The input arrives as 8 lines.

  • The whole input is between 38 and 54 characters long.

Output

  • On the first line print the longer of the two words.

  • The output is between 9 and 16 characters long.

  • Do not add any other characters.

  • Not a single character may differ from the expected value.

Requirements

  • The input is two lines, one word per line.
  • The output is the longer of the two words.
  • This is chat mode. The prompt is wrapped in a chat template, so the model becomes an assistant. You can write control tokens yourself to build a conversation of several turns.
  • One case is split into eight pieces. Four agents take two pieces each, two merge those results, and one finishes up. The model runs seven times.
  • The same prompt is used at every position. At a leaf it receives the two original pieces, and at a merging position it receives the two results from below. It has to work in both.
  • Grading looks only at the output of the single agent at the top. If something goes wrong in the middle, it spreads straight upward.
  • The output must match the expected value down to the last character. Only leading and trailing whitespace is ignored.
  • This problem is solved with SmolLM2 360M. It is a far smaller model than Qwen3 0.6B, so the same prompt does not simply carry over.
  • There are 16 cases, and 5 of them show the input together with the expected output. The rest show the input only.
  • Model output is accepted up to 120 tokens.
  • Passing 14 or more of the 16 cases solves this.
Read the requirements carefully before solving. Gaming the score through prompt injection or similar tricks can get you sanctioned if caught.

Examples

5 public cases. Judging also uses hidden cases. Passing 14 or more of the 16 cases solves this.

Input
Expected output
coax
bridge
pen
waterfall
sky
orange
lamp
window
waterfall
judge
token
margin
prompt
stone
riverbank
apple
desk
riverbank
model
local
candle
tiger
mountainous
paper
cloud
table
mountainous
green
north
pencil
elephantine
water
music
chair
road
elephantine
street
blue
notebook
cup
incomprehensible
map
door
fan
incomprehensible

Notes

Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.

SmolLM2 360M is a fraction of the size of Qwen3 0.6B. It lets instructions slide far more often. You have to say the same thing more briefly and more clearly for it to listen.

Prompt

SmolLM2 360M
Input to preview
This is the exact text that goes into the model (Sample input 1 is used here.)
This problem wraps your text in a chat template, so the exact text can only be shown once the model is loaded. Load SmolLM2 360M first with the button below.
The same prompt runs at the leaves and at the merge step. Both receive two lines of text.
0 chars
To solve problems you need to log in.