FrontierCS - Algorithmic Problems
Problem Structure
Each problem in problems/{id}/ contains:
problems/{id}/
βββ statement.txt # Problem description
βββ tag.txt # Category tag
βββ config.yaml # Time/memory limits, test count
βββ testdata/ # Test cases (public: 1 per problem)
β βββ 1.in
β βββ 1.ans
βββ chk.cc / interactor.cc # Checker or interactor
Quick Start
Start Judge Server
docker-compose up --build -d # First time
docker-compose up -d # Subsequent runs
Judge runs at http://localhost:8081.
How It Works
- Fetch problem statement from judge API
- Generate solution via LLM (C++ code)
- Submit to judge server
- Poll for result
- Score based on test case pass rate
The judge sever will save solutions and their detailed judging results under the folder algorithmic/submissions.
Judge API
| Endpoint | Description |
|---|---|
GET /problems |
List all problems |
GET /problem/{id}/statement |
Get problem statement |
POST /submit |
Submit solution |
GET /result/{sid} |
Get submission result |
Python API
from frontier_cs import FrontierCSEvaluator
evaluator = FrontierCSEvaluator()
# Evaluate an algorithmic problem
result = evaluator.evaluate("algorithmic", problem_id=1, code=cpp_code)
print(f"Score: {result.score}")
# Get unbounded score (without clipping)
result = evaluator.evaluate("algorithmic", problem_id=1, code=cpp_code, unbounded=True)
print(f"Score (bounded): {result.score}")
if hasattr(result, 'score_unbounded'):
print(f"Score (unbounded): {result.score_unbounded}")
CLI
# Evaluate a solution
frontier-eval --algorithmic 1 solution.cpp
# Get unbounded score
frontier-eval --algorithmic 1 solution.cpp --unbounded
Customized Problems
Create
problems/{id}/directoryAdd required files:
statement.txt: Problem descriptionconfig.yaml: Limits and test counttestdata/: Input/output fileschk.ccorinteractor.cc: Checker/interactor
Restart judge to pick up new problems
Judge Sever Configuration
config.yaml
time_limit: 1000 # ms
memory_limit: 262144 # KB
test_count: 10
checker: chk.cc # or interactor: interactor.cc
docker-compose.yml
environment:
PORT: "8081" # API port
JUDGE_WORKERS: "8" # Concurrent evaluations
GJ_PARALLELISM: "8" # go-judge parallelism