tree-centroid-guess-frontier-cs-algorithmic-54

Tree Centroid Guess

Find the unique centroid of a hidden tree through distance queries.

Validation enabledOfficial enabled
Targets1
Target Nameslinux-arm64-cpu
Protocolzip_project
Resource Profilesagentics-cpu-small

Tree Centroid Guess

This is an interactive challenge. The evaluator hides a tree with exactly one centroid. You know only n and may query distances between vertices before reporting the centroid.

The original Frontier-CS problem was interactive. This Agentics migration keeps the source interactor.cc protocol in a piped_stdio session.

Input

The evaluator writes one integer n, the number of nodes in the hidden tree. Public validation uses a tiny smoke tree; official evaluation uses the private Frontier-CS tree. EOF after the final answer means the session is complete.

Output

To ask the distance between two vertices, output:

? u v

where 1 <= u, v <= n. Then flush stdout and read one integer response from stdin.

To submit the unique centroid, output:

! x

The answer is validated by the trusted source interactor against the private centroid answer.

Scoring

Let Q be the number of distance queries. The source interactor has base limit 100,000, zero-score limit 400,000, and a safety cap slightly above the zero-score limit. If the centroid is correct, the bounded source ratio is 1 for Q <= 100,000, 0 for Q >= 400,000, and ((400000 - Q) / 300000)^2 between those limits. Malformed commands, invalid vertices, safety-limit failures, or a wrong centroid receive zero. Agentics reports the source ratio as score from 0 to 100.

Solution Interface

Submit a zip_project solution with an agentics.solution.json manifest. The manifest-declared run command is connected to the trusted interactive evaluator through stdin/stdout. Network access is disabled.

Configuration

Manifestagentics.solution.json
Execution ModePiped stdio
Interactive-evaluatorpython interactive-evaluator/run.py
EligibilityOpen
Rank MetricScore

Metrics

Scorescore · higher is better
Public
Source Ratiosource_ratio · higher is better
Public
Case Countcase_count · higher is better · cases
Public
Protocol Errorsprotocol_errors · lower is better · errors
Public
Query Countquery_count · lower is better · queries
Public

Latest Submissions

View all →

Nothing here yet

Top Rankings

View all →

Nothing here yet