{"name":"leaderboard001-5puzzle-verifier","lang":"python3","entry":"spec-lb001.py","script":"#!/usr/bin/env python3\n\"\"\"Verifier for leaderboard001 (5-puzzle sprint).\nInput: submission dir with answers.json. Output JSON verdict; exit 0 iff pass.\nAll standard answers recomputed from scratch by this verifier (independent of proposers).\n\"\"\"\nimport json, os, sys\nfrom math import comb\n\ndef emit(v, r):\n print(json.dumps({\"verdict\": v, \"reason\": r}, ensure_ascii=False))\n sys.exit(0 if v == \"pass\" else 1)\n\ndef a1():\n return max(n for n in range(10000, 100000) if str(n) == str(n)[::-1] and n % 77 == 0)\n\ndef a2():\n return sum(n for n in range(1, 2027) if n % 9 == 0)\n\ndef a3():\n s = set()\n a = 1\n N = 100000\n while a * a <= N:\n b = 1\n while a * a * b ** 3 <= N:\n s.add(a * a * b ** 3); b += 1\n a += 1\n pw = sorted(x for x in s if x > 1)\n return max(x for x, y in zip(pw, pw[1:]) if y - x == 1)\n\ndef a4():\n def z(n):\n c, p = 0, 5\n while p <= n:\n c += n // p; p *= 5\n return c\n best = None\n for n in range(1, 100000):\n if z(n) == 2026:\n best = n\n return best\n\ndef a5():\n return comb(40, 20) % (10 ** 9 + 7)\n\ndef main():\n if len(sys.argv) < 2: emit(\"invalid\", \"no submission path\")\n f = os.path.join(sys.argv[1], \"answers.json\")\n if not os.path.isfile(f): emit(\"invalid\", \"answers.json missing\")\n try:\n d = json.load(open(f))\n sub = {k: int(v) for k, v in d[\"answers\"].items()}\n except Exception as e:\n emit(\"invalid\", f\"bad answers.json: {e}\")\n key = {\"P1\": a1(), \"P2\": a2(), \"P3\": a3(), \"P4\": a4(), \"P5\": a5()}\n wrong = [k for k in key if sub.get(k) != key[k]]\n if wrong:\n emit(\"fail\", f\"wrong answers: {wrong}; expected { {k: key[k] for k in wrong} }\")\n emit(\"pass\", \"5/5 correct\")\n\nif __name__ == \"__main__\":\n main()\n","input":"A submission directory containing answers.json per proposition pin://ee61ad1dd3b37ff1f46ae84914eec1b1e608b61504380ef4f0762c02f4d71699i0","output":"JSON {verdict: pass|fail|invalid, reason}; exit 0 iff pass","validation":{"null_tolerance":true,"enumeration_closure":{"closure":"harness self-check pre-publish: (a) full correct answers.json => pass; (b) corrupted P1 => fail with expected value; (c) all five standard answers recomputed independently by verifier brute force","selfCheckCount":3},"proposition_fidelity":{"artifact":"pin://ee61ad1dd3b37ff1f46ae84914eec1b1e608b61504380ef4f0762c02f4d71699i0","role":"correspondence artifact: original problem set, submission schema, judging rules","independence":"pinned before spec publication; spec references it read-only"}}}