Commit Graph
35 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 210c7c38f7 Add in-progress problems and saved test outputs
Test and publish the site / publish (push) Successful in 51s
Test and publish the site / test (push) Successful in 49s
excel-sheet, min-effort-path and queue-with-stack (Rust) and
set-xor-min, plus expected outputs for and-or-sort, minus-two and
moo-language-school.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:18:08 +01:00
adamfandClaude Opus 5.5 1aee0050a0 Add Rust support: usaco lang, lint, and main.rs problems
Brings in the stashed Rust work, merged onto the current CLI. A
problem's language is whichever source it has (main.cpp or main.rs);
'usaco lang' sets the default for new problems (.lang, or $USACO_LANG),
and 'new --rust/--cpp' picks per problem. template.rs is a paste-ready
Rust template whose stdio() uses <io>.in/.out when present and
stdin/stdout otherwise.

run/test now feed <io>.in on stdin and capture stdout when the program
doesn't write <io>.out itself, so Codeforces-style solutions work too.
'reset <name> rust|cpp' switches a problem's language (template is
still an alias), and --debug builds Rust with overflow checks and debug
assertions. 'usaco lint' runs clippy through a generated, gitignored
Cargo.toml that also gives rust-analyzer a project; done/skip/undo
keep it in step. LeetCode imports stay C++.

Also: done stages solved/ and solving/ separately, so a problem that
was never committed from solving/ still gets its "Solve" commit, and
the site lists main.rs ahead of other files like it does main.cpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:17:50 +01:00
adamfandClaude Opus 5.5 e821df15f4 Import LeetCode problems with usaco new <link> / usaco daily
Test and publish the site / test (push) Successful in 35s
Test and publish the site / publish (push) Successful in 29s
usaco new <leetcode-link> (alias: from) and usaco daily fetch a problem
from LeetCode's GraphQL API and write problem.md, main.cpp (template
header + LeetCode's C++ starter), a generated driver.h that runs the
solution on LeetCode-format input, and the examples as tests with the
expected outputs from the statement. leetcode.h holds ListNode/TreeNode
and the parse/print helpers; everything local sits behind #ifdef LOCAL
so main.cpp stays submittable.

reset re-fetches the starter code for LeetCode problems, the REPL's new
selects the imported problem, and usaco.zsh turns off globbing so a
pasted ?envType=... link works unquoted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:12:16 +01:00
adamfandClaude Opus 5.5 995b44a57a Add an Explain button that has Claude explain a problem
Test and publish the site / publish (push) Successful in 8m15s
Test and publish the site / test (push) Successful in 5m51s
When stuck, the admin can ask Claude for an intuitive explanation of a
problem. It is committed as explain.md and shown as folded sections, so
the reader opens only as much as they need: the key observation, hints
that get stronger, the approach, a walkthrough with an SVG diagram per
step, complexity, pitfalls and a pseudocode sketch.

- internal/claude: streamed call with a JSON-schema reply, high effort,
  the server-side refusal fallback, fixed error messages and logged
  token usage. CLAUDE_API_KEY and CLAUDE_MODEL (default claude-opus-5-5);
  without a key only this feature is off.
- internal/explain: the prompt, the schema, rendering to markdown, and
  a per-problem job tracker. The request starts a job and the page polls,
  since a call outlasts nginx's 120s timeout.
- internal/statement: fetches statements from LeetCode's GraphQL API and
  USACO's problem pages. Others (Codeforces is behind Cloudflare) are
  pasted.
- problem.md holds the statement, editable from the meta editor and
  shown only to the admin. Diagrams are sanitized with DOMPurify.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 20:38:15 +01:00
adamfandClaude Opus 5.5 f0e10d2a58 Roll out under .compose.lock and drop the Docker API pin
Test and publish the site / test (push) Successful in 11s
Test and publish the site / publish (push) Successful in 3s
env-apply was removed from web_server, so its run/lock no longer exists
and the roll-out step failed with "cannot open lock file". Take
.compose.lock, which web_server's deploy and maintenance workflows hold.
The DOCKER_API_VERSION=1.41 pin was for the Pi's Docker 20.10; the host
now runs Docker 29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 18:07:36 +01:00
adamfandClaude Opus 5.5 3e2b52fdb2 Describe the CI host as stpvm, not the Pi
Test and publish the site / test (push) Successful in 1m29s
Test and publish the site / publish (push) Failing after 2s
The site and its runner moved from the arm64 Pi to stpvm (x86-64,
Docker 29), so the comments about the build host, its Docker version
and the image architecture were wrong.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 17:58:03 +01:00
adamfandClaude Opus 5.5 675410729e Link the site to the repo on Gitea
Test and publish the site / test (push) Successful in 39s
Test and publish the site / publish (push) Successful in 50s
A Source link in the header, and on the CLI page links to the script,
lib/cmd, usaco.zsh, the README, the template and debugging.h, plus the
clone URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:45:50 +01:00
adamfandClaude Opus 5.5 cbf5cc32b7 Add a CLI guide page to the website
Test and publish the site / test (push) Successful in 32s
Test and publish the site / publish (push) Successful in 1m0s
/usaco/cli summarises the ./usaco commands, setup, a typical session and
interactive mode, linked from the header. It's a hand-written copy of the
README (the Docker build context is site/, so it can't import it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:27:39 +01:00
adamfandClaude Opus 5.5 ac66ad6b03 Tidy the usaco CLI: prefixes everywhere, LOCAL debug builds, git-based dates
- done/skip/undo accept unique prefixes like every other command
- builds define LOCAL (-I repo root): the template includes debugging.h
  and enables DBG/printV only locally, so main.cpp is submittable as-is
- run/build/test --debug (or USACO_DEBUG=1): ASan/UBSan + _GLIBCXX_DEBUG
- list/stats date problems by git history, not mtimes reset by checkouts
- template/tpl is now an alias of reset (which gains -y); fixes template
  dropping the STDIO line
- run shows <io>.out via detect_io instead of the first *.out
- debugging.h: size_t loop indices (no -Wsign-compare noise)
- zsh completion for i/cat/copy; README covers test, io, reset, --debug
- ignore a.out

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 22:39:16 +01:00
adamfandClaude Opus 5.5 1c647072c5 Add usaco sync; track saved test outputs
Test and publish the site / test (push) Successful in 4m29s
Test and publish the site / publish (push) Successful in 1m25s
The website commits too, so `usaco sync` pulls its edits before pushing.
tests/*.out were swallowed by the *.out rule; they are expected outputs
the site shows, so re-include them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00
adamfandClaude Opus 5.5 6d956f1c76 Add the website: Go server + Vue SPA in site/, with CI
A standalone container for web_server, shaped like job-tracker: serves
/usaco/ with solved problems public and solving/skipped plus edits
(status, link, notes) for the site admin. Git is the only store: the
server clones adamf/usaco from Gitea, pulls on the push webhook, and
commits edits back. CI builds the image only when site/ changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00
adamf 440d51caba new problems 2026-09-25 22:31:50 +01:00
adamf fe0b8be533 Solve nezzar-and-lucky-number 2026-09-24 17:06:59 +01:00
adamf 25ba615045 update template to codeforces compliant 2026-09-24 15:49:13 +01:00
adamf c09007a751 Solve odd-divisor 2026-09-24 15:45:55 +01:00
adamf 8ac02faee4 Solve the-cake-is-a-lie 2026-09-24 15:29:15 +01:00
adamf ef9a67918e More questions 2026-09-24 13:32:35 +01:00
adamf 218fd77c8c More problems, update template 2026-09-24 13:29:53 +01:00
adamfandClaude Code c5efae17e4 Document cat, copy, and interactive REPL in README
Co-Authored-By: Claude Code <[email protected]>
2026-09-24 13:15:32 +01:00
adamfandClaude Code 1b78b35876 Add usaco interactive REPL with current-problem context
Co-Authored-By: Claude Code <[email protected]>
2026-09-24 13:12:37 +01:00
adamfandClaude Code 26a9c969bd Add usaco cat and copy commands
Co-Authored-By: Claude Code <[email protected]>
2026-09-24 12:51:33 +01:00
adamf 0b2113f577 Solve reflection 2026-09-22 21:51:16 +01:00
adamf df25347183 Solve purchasing-milk 2026-09-22 21:51:16 +01:00
adamf b7786bc4ce Solve moocast 2026-09-22 21:51:16 +01:00
adamf efafed7e91 Solve measuring-traffic 2026-09-22 21:51:16 +01:00
adamf 128448ebed Solve longest-common-subsequence 2026-09-22 21:51:16 +01:00
adamf 17a4768bc8 Solve largest-rectangle-in-histogram 2026-09-22 21:51:16 +01:00
adamf 616f6d0493 Solve kayaking 2026-09-22 21:51:16 +01:00
adamf b3e3693e16 Solve diamond-collector 2026-09-22 21:51:16 +01:00
adamf 2829480c87 new template 2026-09-22 17:59:52 +01:00
adamf 8e44324146 new problems 2026-09-20 23:31:20 +01:00
adamf afdab7d4bd Separate lib, new problems and script for web 2026-08-26 22:25:19 +01:00
adamf 6fd6d70b04 Vibe code scripts to edit and add usaco solutions 2026-08-25 00:45:15 +01:00
adamf a79ff12290 Current work 2026-08-03 19:03:58 +01:00
adamf b48299efb7 first commit 2026-08-03 19:03:02 +01:00