Publish IMO-ProofBench Harbor tasks (part 2)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- tasks/pb-basic-011/tests/test.shAdded+10
- tasks/pb-basic-012/instruction.mdAdded+26
- tasks/pb-basic-012/solution/solve.shAdded+7
- tasks/pb-basic-012/task.tomlAdded+20
- tasks/pb-basic-012/tests/grade_task.pyAdded+58
- tasks/pb-basic-012/tests/reference.jsonAdded+12
- tasks/pb-basic-012/tests/test.shAdded+10
- tasks/pb-basic-013/instruction.mdAdded+7
- tasks/pb-basic-013/solution/solve.shAdded+15
- tasks/pb-basic-013/task.tomlAdded+20
- tasks/pb-basic-013/tests/grade_task.pyAdded+58
- tasks/pb-basic-013/tests/reference.jsonAdded+12
- tasks/pb-basic-013/tests/test.shAdded+10
- tasks/pb-basic-014/instruction.mdAdded+7
- tasks/pb-basic-014/solution/solve.shAdded+7
- tasks/pb-basic-014/task.tomlAdded+20
- tasks/pb-basic-014/tests/grade_task.pyAdded+58
- tasks/pb-basic-014/tests/reference.jsonAdded+12
- tasks/pb-basic-014/tests/test.shAdded+10
- tasks/pb-basic-015/instruction.mdAdded+7
- tasks/pb-basic-015/solution/solve.shAdded+9
- tasks/pb-basic-015/task.tomlAdded+20
- tasks/pb-basic-015/tests/grade_task.pyAdded+58
- tasks/pb-basic-015/tests/reference.jsonAdded+12
- tasks/pb-basic-015/tests/test.shAdded+10
- tasks/pb-basic-016/instruction.mdAdded+9
- tasks/pb-basic-016/solution/solve.shAdded+13
- tasks/pb-basic-016/task.tomlAdded+20
- tasks/pb-basic-016/tests/grade_task.pyAdded+58
- tasks/pb-basic-016/tests/reference.jsonAdded+12
- tasks/pb-basic-016/tests/test.shAdded+10
- tasks/pb-basic-017/instruction.mdAdded+7
- tasks/pb-basic-017/solution/solve.shAdded+7
- tasks/pb-basic-017/task.tomlAdded+20
- tasks/pb-basic-017/tests/grade_task.pyAdded+58
- tasks/pb-basic-017/tests/reference.jsonAdded+12
- tasks/pb-basic-017/tests/test.shAdded+10
- tasks/pb-basic-018/instruction.mdAdded+7
- tasks/pb-basic-018/solution/solve.shAdded+9
- tasks/pb-basic-018/task.tomlAdded+20
- tasks/pb-basic-018/tests/grade_task.pyAdded+58
- tasks/pb-basic-018/tests/reference.jsonAdded+12
- tasks/pb-basic-018/tests/test.shAdded+10
- tasks/pb-basic-019/instruction.mdAdded+10
- tasks/pb-basic-019/solution/solve.shAdded+18
- tasks/pb-basic-019/task.tomlAdded+20
- tasks/pb-basic-019/tests/grade_task.pyAdded+58
- tasks/pb-basic-019/tests/reference.jsonAdded+12
- tasks/pb-basic-019/tests/test.shAdded+10
- tasks/pb-basic-020/instruction.mdAdded+7
12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567891011121314151617181920212223242526# PB-Basic-012
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Consider a positive integer $n$. We define $f(n)$ as the number of pairs of paths on an $n \times n$ grid that:
(1) Both paths start at $(0, 0)$ (bottom left corner) and end at $(n, n)$ (top right corner).
(2) Both paths allow only right or up movements (one unit each).
(3) The $y$ coordinate of the first path never exceeds the y coordinate of the second path at any timestep.
For example, when $n = 2$, consider the following pair of paths:
The first path: $(0,0) \rightarrow (1,0) \rightarrow (1,1) \rightarrow (2,1) \rightarrow (2,2)$ The second path: $(0,0) \rightarrow (1,0) \rightarrow (2,0) \rightarrow (2,1) \rightarrow(2,2)$ The example is invalid because after 2 steps, the y coordinate of the first path (1) is larger than the y coordinate of the second path (0).
However, the following example is valid,
The first path: $(0,0) \rightarrow (1,0) \rightarrow (2,0) \rightarrow (2,1) \rightarrow (2,2)$ The second path: $(0,0) \rightarrow (1,0) \rightarrow (1,1) \rightarrow (2,1) \rightarrow (2,2)$
since the y coordinate of the first path is never larger than the second path. Find $f(10)$.1234567#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_133d3fe55786fb9d1fb9d4008deb6e4f886e8977d43639df018b6c1c63debb2a'If we move the second path up-left by one unit, the pair of paths corresponds to a pair of paths from (0,0) to (10,10) and from (-1,1) to (9,11) which are non-intersecting. The total number of path pairs is $\binom{20}{10}^2$. The number of intersecting pairs corresponds to the number of pair of paths from (0,0) to (9, 11) and paths from (-1, 1) to (10,10), because interchanging the two paths at the first intersection point gives a one-to-one correspondence, and thus equals $\binom{20}{9}^2$. Therefore there are $\binom{20}{10}^2 - \binom{20}{9}^2$ paths.IMO_PROOF_133d3fe55786fb9d1fb9d4008deb6e4f886e8977d43639df018b6c1c63debb2a1234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-012"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-012"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "Consider a positive integer $n$. We define $f(n)$ as the number of pairs of paths on an $n \\times n$ grid that:\n\n (1) Both paths start at $(0, 0)$ (bottom left corner) and end at $(n, n)$ (top right corner).\n\n (2) Both paths allow only right or up movements (one unit each).\n\n (3) The $y$ coordinate of the first path never exceeds the y coordinate of the second path at any timestep.\n\n For example, when $n = 2$, consider the following pair of paths:\n\n The first path: $(0,0) \\rightarrow (1,0) \\rightarrow (1,1) \\rightarrow (2,1) \\rightarrow (2,2)$\n The second path: $(0,0) \\rightarrow (1,0) \\rightarrow (2,0) \\rightarrow (2,1) \\rightarrow(2,2)$\n The example is invalid because after 2 steps, the y coordinate of the first path (1) is larger than the y coordinate of the second path (0).\n\n However, the following example is valid,\n\n The first path: $(0,0) \\rightarrow (1,0) \\rightarrow (2,0) \\rightarrow (2,1) \\rightarrow (2,2)$\n The second path: $(0,0) \\rightarrow (1,0) \\rightarrow (1,1) \\rightarrow (2,1) \\rightarrow (2,2)$\n\n since the y coordinate of the first path is never larger than the second path. Find $f(10)$.", "solution": "If we move the second path up-left by one unit, the pair of paths corresponds to a pair of paths from (0,0) to (10,10) and from (-1,1) to (9,11) which are non-intersecting. The total number of path pairs is $\\binom{20}{10}^2$. The number of intersecting pairs corresponds to the number of pair of paths from (0,0) to (9, 11) and paths from (-1, 1) to (10,10), because interchanging the two paths at the first intersection point gives a one-to-one correspondence, and thus equals $\\binom{20}{9}^2$. Therefore there are $\\binom{20}{10}^2 - \\binom{20}{9}^2$ paths.", "grading_guidelines": "(Partial)\n 1. Came up with an idea of correcting shifting (shifting only one path by $+1$ in the $y$-coordinate) or found an equivalent idea with it.\n(Almost)\n 1. Made a minor mistake when counting.", "problem_id": "PB-Basic-012", "level": "basic", "category": "Combinatorics", "source": "Novel Problem", "max_score": 7, "difficulty": "IMO-medium", "short_answer": "$\\binom{20}{10}^2 - \\binom{20}{9}^2$ "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-013
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Each of 8 boxes contains 6 balls. Each ball has been colored with one of 22 colors. If no two balls in the same box are the same color, prove that there are two colors that occur together in more than one box.123456789101112131415#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_15c8b8ab464de13b112ed964b40d9cfc6b39ac48a66e7bac459b58ae1265063d'Let’s say a color "connects" two boxes if it appears in both. We want to show there are two colors that connect the same pair of boxes.
Let $c_i$ denote the number of balls with color $i$. Then, the total number of times a color connects two boxes is $N = \sum_{i=1}^{22} \binom{c_i}{2}$. We also know the total number of balls is $48$, so $\sum_{i=1}^{22} c_i = 48$. We now try to find the minimum possible value of $N$.
To do this, we first analyze the quantity $X = \sum_{i=1}^{22} (c_i - 2)^2$. If at $|c_i - 2| >= 2$ for some $i$, then clearly $X \ge 4$. Otherwise, all the $c_i$ are 1, 2, or 3. Then, in order for them to sum to 48, at most 18 of them can be 2, so once again $X \ge 4$. We then have
$4 \le X = 2N - 3 \sum_{i=1}^{22} c_i + 4 * 22 = 2N - 3 * 48 + 4 * 22 = 2N - 56$,
so that $N \ge 30$. But note that there are only $\binom{8}{2} = 28$ pairs of boxes. Thus, by the pigeonhole principle, some two colors connect the same pair of boxes, as desired.IMO_PROOF_15c8b8ab464de13b112ed964b40d9cfc6b39ac48a66e7bac459b58ae1265063d1234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-013"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-013"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "Each of 8 boxes contains 6 balls. Each ball has been colored with one of 22 colors. If no two balls in the same box are the same color, prove that there are two colors that occur together in more than one box.", "solution": "Let’s say a color \"connects\" two boxes if it appears in both. We want to show there are two colors that connect the same pair of boxes.\n\n Let $c_i$ denote the number of balls with color $i$. Then, the total number of times a color connects two boxes is $N = \\sum_{i=1}^{22} \\binom{c_i}{2}$. We also know the total number of balls is $48$, so $\\sum_{i=1}^{22} c_i = 48$. We now try to find the minimum possible value of $N$.\n\n To do this, we first analyze the quantity $X = \\sum_{i=1}^{22} (c_i - 2)^2$. If at $|c_i - 2| >= 2$ for some $i$, then clearly $X \\ge 4$. Otherwise, all the $c_i$ are 1, 2, or 3. Then, in order for them to sum to 48, at most 18 of them can be 2, so once again $X \\ge 4$. We then have\n\n $4 \\le X = 2N - 3 \\sum_{i=1}^{22} c_i + 4 * 22 = 2N - 3 * 48 + 4 * 22 = 2N - 56$,\n\n so that $N \\ge 30$. But note that there are only $\\binom{8}{2} = 28$ pairs of boxes. Thus, by the pigeonhole principle, some two colors connect the same pair of boxes, as desired.", "grading_guidelines": "(Partial)\n 1. Applied some double counting argument but did not progress further.\n(Almost)\n 1. Solved the problem with some mistakes (such as calculation mistakes).", "problem_id": "PB-Basic-013", "level": "basic", "category": "Combinatorics", "source": "(Modified) USAMO 2001 P1", "max_score": 7, "difficulty": "pre-IMO", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-014
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
In Shoreline Amphitheatre, 2024 Googlers each hold up to five flags of various colors. Any group of three Googlers will always have at least two people holding flags of the same color. Prove that one specific flag color is held by at least 200 Googlers.1234567#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_670930ab666534527fd6ba7d838c7cc4696ffa1e709fc2b980c854f4318f9004'Take any Googler. He holds at most 5 flags. If everyone holds at least one of those flags but not more than 199 people speak have each flag, then there are at most 1 + 5·198 = 991 Googlers. But there are 2024 Googlers, so we must be able to find someone who holds none of the 5 flags. He too has at most 5 flags, giving a total of 10 between the two Googlers selected. Now we are told that every other Googler holds at least one of these 10 flags. So if no more than 199 Googlers holds each flag, then there are at most 2 + 10·198 = 1982 Googlers. But there are 2024 Googlers, so one of the 10 flags must be held by 200 or more people.IMO_PROOF_670930ab666534527fd6ba7d838c7cc4696ffa1e709fc2b980c854f4318f90041234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-014"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-014"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "In Shoreline Amphitheatre, 2024 Googlers each hold up to five flags of various colors. Any group of three Googlers will always have at least two people holding flags of the same color. Prove that one specific flag color is held by at least 200 Googlers.", "solution": "Take any Googler. He holds at most 5 flags. If everyone holds at least one of those flags but not more than 199 people speak have each flag, then there are at most 1 + 5·198 = 991 Googlers. But there are 2024 Googlers, so we must be able to find someone who holds none of the 5 flags. He too has at most 5 flags, giving a total of 10 between the two Googlers selected. Now we are told that every other Googler holds at least one of these 10 flags. So if no more than 199 Googlers holds each flag, then there are at most 2 + 10·198 = 1982 Googlers. But there are 2024 Googlers, so one of the 10 flags must be held by 200 or more people.", "grading_guidelines": "(Partial)\n 1. Established that there is a pair of people not sharing a flag of the same color.\n (Almost)\n 1. Solution is almost complete, but made minor mistakes which are not negligible.", "problem_id": "PB-Basic-014", "level": "basic", "category": "Combinatorics", "source": "(Modified) Balkan MO 1985 P4", "max_score": 7, "difficulty": "pre-IMO", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-015
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Adrian is lining up $n \geq 2$ toy cars in a row. Each car has a width and length, and no two cars have the same width or length. Initially, the cars are arranged in increasing order of length from left to right. Adrian repeatedly does the following: he chooses some two adjacent cars where the left car is shorter in length and greater in width than the right car, and he swaps them. He keeps doing this until no further moves are possible. Prove that no matter how Adrian chooses his swaps, the procedure will eventually terminate, and in the end, the cars will be sorted in increasing order of width from left to right.123456789#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_905fd4cb26979d414351be9b96213c52584afc264c07a7eb52815c94c2a81ee4'Define an inversion to be a pair of cars where the one on the left is wider than the one on the right. Clearly, each move strictly decreases the number of inversions, so the procedure must terminate.
Now, suppose for sake of contradiction that we can make no more moves, but the cars are not sorted in increasing order of width. Consider the smallest index $i$ such that car $i$ is wider than car $i + 1$. Since we cannot make any further swaps, it must also be the case that car $i$ is longer than book $i + 1$. This means that originally, car $i$ was to the right of car $i + 1$, and at some point they switched relative positions. However, this is not possible because the rules prevent us from ever swapping two books when one is both taller and wider than the other.IMO_PROOF_905fd4cb26979d414351be9b96213c52584afc264c07a7eb52815c94c2a81ee41234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-015"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-015"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "Adrian is lining up $n \\geq 2$ toy cars in a row. Each car has a width and length, and no two cars have the same width or length. Initially, the cars are arranged in increasing order of length from left to right. Adrian repeatedly does the following: he chooses some two adjacent cars where the left car is shorter in length and greater in width than the right car, and he swaps them. He keeps doing this until no further moves are possible. Prove that no matter how Adrian chooses his swaps, the procedure will eventually terminate, and in the end, the cars will be sorted in increasing order of width from left to right.", "solution": "Define an inversion to be a pair of cars where the one on the left is wider than the one on the right. Clearly, each move strictly decreases the number of inversions, so the procedure must terminate.\n\n Now, suppose for sake of contradiction that we can make no more moves, but the cars are not sorted in increasing order of width. Consider the smallest index $i$ such that car $i$ is wider than car $i + 1$. Since we cannot make any further swaps, it must also be the case that car $i$ is longer than book $i + 1$. This means that originally, car $i$ was to the right of car $i + 1$, and at some point they switched relative positions. However, this is not possible because the rules prevent us from ever swapping two books when one is both taller and wider than the other.", "grading_guidelines": "(Partial)\n 1. Found an increasing quantity (e.g. the number of inversion according to the width or length)\n 2. Tried to use minimality argument by taking the first book not sorted by width.\n(Almost)\n 1. Solution is almost complete, but made minor mistakes which are not negligible.", "problem_id": "PB-Basic-015", "level": "basic", "category": "Combinatorics", "source": "(Modified) 2020 USOJMO P1", "max_score": 7, "difficulty": "pre-IMO", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"123456789# PB-Basic-016
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
101 stones are arranged in a circle, numbered 1 through 101 in order (so that stone 1 is next to stone 101). Each stone is painted either red, white, or blue. Initially, stone 101 is the only blue stone. Among the remaining stones, even-numbered stones are red, and odd-numbered stones are white.
We perform a sequence of modifications to the coloring, where in each step, we may choose a stone and repaint it a different color, as long as we ensure that no two adjacent stones are ever the same color. Prove that it is not possible to eventually reach a state where again stone 101 is the only blue stone, but among the remaining stones, all even-numbered stones are white and all odd-numbered stones are red.12345678910111213#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_a26399654be52ba0ffb8544a40186c12222e4ac40472531796bbc0390fa4a33e'Let $A$ be the number of indices $i$ where $i$th stone is blue and $i+1$th stone is white (we define the order in mod 101). Similarly, let $C$ be the number of white stones followed by blue stones. In the initial state, we have $A = 1$ and $C = 0$, and in the final state, we have $A = 0$ and $C = 1$.
We claim that $A - C$ is invariant. Indeed, consider all possible colorings of three consecutive stones, and let us enumerate what color the middle side can be changed to. Writing $R, W, B$ to represent red, white, and blue, we have the following possibilities: \[ RBR \to RWR, \qquad RWR \to RBR, \] \[ BWB \to BRB, \qquad BRB \to BWB, \] \[ WBW \to WRW, \qquad WRW \to WBW. \] In each case, we find that the quantity $A - C$ doesn't change. However, the initial state has $A - C = 1$, and the final state has $A - C = -1$, so it is not possible to reach the final state.IMO_PROOF_a26399654be52ba0ffb8544a40186c12222e4ac40472531796bbc0390fa4a33e1234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-016"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-016"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "101 stones are arranged in a circle, numbered 1 through 101 in order (so that stone 1 is next to stone 101). Each stone is painted either red, white, or blue. Initially, stone 101 is the only blue stone. Among the remaining stones, even-numbered stones are red, and odd-numbered stones are white.\n\nWe perform a sequence of modifications to the coloring, where in each step, we may choose a stone and repaint it a different color, as long as we ensure that no two adjacent stones are ever the same color. Prove that it is not possible to eventually reach a state where again stone 101 is the only blue stone, but among the remaining stones, all even-numbered stones are white and all odd-numbered stones are red.", "solution": "Let $A$ be the number of indices $i$ where $i$th stone is blue and $i+1$th stone is white (we define the order in mod 101). Similarly, let $C$ be the number of white stones followed by blue stones. In the initial state, we have $A = 1$ and $C = 0$, and in the final state, we have $A = 0$ and $C = 1$.\n\n We claim that $A - C$ is invariant. Indeed, consider all possible colorings of three consecutive stones, and let us enumerate what color the middle side can be changed to. Writing $R, W, B$ to represent red, white, and blue, we have the following possibilities:\n \\[ RBR \\to RWR, \\qquad RWR \\to RBR, \\]\n \\[ BWB \\to BRB, \\qquad BRB \\to BWB, \\]\n \\[ WBW \\to WRW, \\qquad WRW \\to WBW. \\]\n In each case, we find that the quantity $A - C$ doesn't change. However, the initial state has $A - C = 1$, and the final state has $A - C = -1$, so it is not possible to reach the final state.", "grading_guidelines": "(Partial)\n 1. Analyzed all the possible cases for when a stone changes color in terms of its neighbors' colors.\n(Almost)\n 1. Solution is almost complete, but made minor mistakes which are not negligible.", "problem_id": "PB-Basic-016", "level": "basic", "category": "Combinatorics", "source": "(Modified) USAMO 1994 Problem 2", "max_score": 7, "difficulty": "pre-IMO", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-017
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Find all non-negative integer $n$ such that $A_n = 1 + 3^{20(n^2+n+1)} + 9^{14(n^2+n+1)}$ is a prime number.1234567#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_af70f5b4e524915b3f1cd1fe86201b51c283b297e51cf861dad5858235257926'Substitute $a = 3^{4(n^2+n+1)} \geq 81 \in Z^+$, we have $A_n = a^7 + a^5 + 1$. Observe that $a^7 + a^5 + 1 = (a^2+a+1)(a^5-a^4+a^3-a+1)$. Since $a \geq 81$, we have $a^2+a+1 > 1$ and $a^5-a^4+a^3-a+1 > 1$. Hence, $A_n$ is not a prime number for all $n \geq 0$.IMO_PROOF_af70f5b4e524915b3f1cd1fe86201b51c283b297e51cf861dad58582352579261234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-017"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-017"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "Find all non-negative integer $n$ such that $A_n = 1 + 3^{20(n^2+n+1)} + 9^{14(n^2+n+1)}$ is a prime number.", "solution": "Substitute $a = 3^{4(n^2+n+1)} \\geq 81 \\in Z^+$, we have $A_n = a^7 + a^5 + 1$. Observe that $a^7 + a^5 + 1 = (a^2+a+1)(a^5-a^4+a^3-a+1)$. Since $a \\geq 81$, we have $a^2+a+1 > 1$ and $a^5-a^4+a^3-a+1 > 1$. Hence, $A_n$ is not a prime number for all $n \\geq 0$.", "grading_guidelines": "(Partial)\n 1. Applied correct substitution to $x^7+x^5+1$ or $x^{14}+x^{10}+1$ or $x^{28}+x^{20}+1$\n(Almost)\n 1. Correctly applied substitution and factorization but with made minor mistakes.", "problem_id": "PB-Basic-017", "level": "basic", "category": "Number theory", "source": "folklore", "max_score": 7, "difficulty": "pre-IMO", "short_answer": "There is no such $n$."}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-018
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Let $x$ and $y$ be positive integers satisfying $2x^2 + x = 3y^2 + y$. Prove that $2x+2y+1$ is a perfect square.123456789#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_3ebc02426db3c6c46b48852a9bcf2281caff784d98ea26251096b3335a515c46'Lemma: If $ab$ is a perfect square for coprime integers $a,b$ then they are perfect squares.
Observe that $2x^2+x=3y^2+y$ is equivalent to $y^2 = 2x^2-2y^2+x-y = (x-y)(2x+2y+1)$. Let $d$ be the greatest common divisior of $x-y,2x+2y+1$, we have $d | x-y$ and $d | 2x+2y+1$. On the other hand, observe that $y^2 = (x-y)(2x+2y+1)$. Hence, we must have that $d^2 | y^2$, which implies $d | y$. Since $d | y$ and $d | x-y$, we have $d | x$. Furthermore, since $d | x, d | y, d | 2x+2y+1$, we have that $d | 1$ and thus, $d = 1$, meaning that $x-y,2x+2y+1$ are coprime integers. From the Lemma, we have that $x-y,2x+2y+1$ are perfect squares. Hence proved.IMO_PROOF_3ebc02426db3c6c46b48852a9bcf2281caff784d98ea26251096b3335a515c461234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-018"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-018"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "Let $x$ and $y$ be positive integers satisfying $2x^2 + x = 3y^2 + y$. Prove that $2x+2y+1$ is a perfect square.", "solution": "Lemma: If $ab$ is a perfect square for coprime integers $a,b$ then they are perfect squares.\n\n Observe that $2x^2+x=3y^2+y$ is equivalent to $y^2 = 2x^2-2y^2+x-y = (x-y)(2x+2y+1)$. Let $d$ be the greatest common divisior of $x-y,2x+2y+1$, we have $d | x-y$ and $d | 2x+2y+1$. On the other hand, observe that $y^2 = (x-y)(2x+2y+1)$. Hence, we must have that $d^2 | y^2$, which implies $d | y$. Since $d | y$ and $d | x-y$, we have $d | x$. Furthermore, since $d | x, d | y, d | 2x+2y+1$, we have that $d | 1$ and thus, $d = 1$, meaning that $x-y,2x+2y+1$ are coprime integers. From the Lemma, we have that $x-y,2x+2y+1$ are perfect squares. Hence proved.", "grading_guidelines": "(Partial)\n 1. Correctly factorized $(x-y)(2x+2y+1) = y^2$ but did not get other non-trivial results.\n(Almost)\n 1. Proved the problem but made minor mistakes or did not prove $d = 1$", "problem_id": "PB-Basic-018", "level": "basic", "category": "Number theory", "source": "(Modified) Polish MO 1965 P4", "max_score": 7, "difficulty": "pre-IMO", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"12345678910# PB-Basic-019
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
For any positive integer $n$, let $\delta(n)$ be the largest odd divisor of $n$. Prove for any $N>0$ that we have \[ \left| \sum_{n=1}^N \frac{\delta(n)}{n}- \frac{2}{3}N \right| <1. \]123456789101112131415161718#!/bin/shset -euPROOF=${PROOF:-/app/proof.md}mkdir -p "$(dirname -- "$PROOF")"cat > "$PROOF" <<'IMO_PROOF_22341fbfa5b1be4d043f86519f346329f13786ede1e24f33d5ea0966194d0106'Observe the following: If the greatest power of $2$ that divides $n$ is $2^k$, the greatest odd divisor dividing $n$ is $\frac{n}{2^k}$.
Let $\sum_{n=1}^N \frac{\delta(n)}{n}$ be $S(N)$.
Let the greatest power of $2$ smaller or equal to $N$ be $2^k$. Then, $2^k \leq N <2^{k+1}$ holds. Using the observation, we get the following equation: $\sum_{n=1}^{2^k} \frac{\delta(n)}{n} = \sum_{i=0}^{k-1} \frac{2^{k-1-i}}{2^i} + \frac{1}{2^k} = 2^{k-1}(\frac{1-\frac{1}{4^{k}}}{\frac{3}{4}}) + \frac{1}{2^k}$
Now observe that for $2^k < n <2^{k+1}$, $\frac{\delta(n)}{n} = \frac{\delta(n-2^k)}{n-2^k}$. Therefore, we have that $S(N)= S(N-2^k)+ (\frac{2^{k+1}}{3})(1-\frac{1}{4^{k}}) + \frac{1}{2^k}$
Using this, we have that $S(N) - \frac{2N}{3} = S(N-2^k) - \frac{2(N-2^k)}{3} + \frac{1}{3\cdot 2^k}$
Therefore, $|S(N) - \frac{2N}{3}|\leq \sum_{k=0}^\infty \frac{1}{3\cdot 2^k} \leq 1$IMO_PROOF_22341fbfa5b1be4d043f86519f346329f13786ede1e24f33d5ea0966194d01061234567891011121314151617181920schema_version = "1.4"artifacts = ["/app/proof.md"][task]name = "imo-proofbench/pb-basic-019"version = "1.0.0"description = "IMO-ProofBench mathematical proof task"keywords = ["math", "proof", "imo"][metadata]problem_id = "PB-Basic-019"level = "basic"[agent]network_mode = "allowlist"timeout_sec = 3600[environment]docker_image = "docker.io/library/python:3.12-slim"cpus = 1memory_mb = 2048[verifier]network_mode = "allowlist"timeout_sec = 18012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Offline structural validation only; external rubric judge assigns 0–7 points."""import json, os, statLIMIT = 200_000
def read_own(path): """Reject links, special files, multiple hard links, and oversized files.""" parts = os.path.abspath(path).split('/')[1:] folder = os.open('/', os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, 'rb') as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError('not a regular file with one link') data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError('file exceeds 200000 bytes') return data
def write_new(path, data): try: os.unlink(path) except FileNotFoundError: pass fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, 'wb') as f: f.write(data)
def main(): out = os.environ['VERIFIER_DIR'] os.makedirs(out, exist_ok=True) write_new(os.path.join(out, 'reward.txt'), b'0\n') proof_path = os.path.join(out, 'proof.md') try: os.unlink(proof_path) except FileNotFoundError: pass reference = open(os.path.join(os.environ['TESTS_DIR'], 'reference.json'), 'rb').read() json.loads(reference) write_new(os.path.join(out, 'reference.json'), reference) status, count, reason = 'missing', 0, 'proof unavailable or invalid' try: raw = read_own(os.environ['PROOF']) proof = raw.decode('utf-8', 'strict') count = len(proof) write_new(proof_path, raw) if sum(not c.isspace() for c in proof) < 20: status, reason = 'empty', 'fewer than 20 non-whitespace characters' else: status, reason = 'submitted_for_judge', 'structurally valid submission' except (OSError, ValueError, UnicodeError) as e: reason = 'proof unavailable or invalid: ' + str(e)[:200] result = {'status': status, 'char_count': count, 'requires_llm_judge': True, 'max_score': 7, 'reason': reason} write_new(os.path.join(out, 'grade.json'), (json.dumps(result, ensure_ascii=False, indent=2)+'\n').encode()) if status == 'submitted_for_judge': write_new(os.path.join(out, 'reward.txt'), b'1\n') print(status, 'structural reward:', int(status == 'submitted_for_judge'))if __name__ == '__main__': main()123456789101112{ "problem": "For any positive integer $n$, let $\\delta(n)$ be the largest odd divisor of $n$. Prove for any $N>0$ that we have\n \\[\n \\left| \\sum_{n=1}^N \\frac{\\delta(n)}{n}- \\frac{2}{3}N \\right| <1.\n \\]", "solution": "Observe the following: If the greatest power of $2$ that divides $n$ is $2^k$, the greatest odd divisor dividing $n$ is $\\frac{n}{2^k}$.\n\n Let $\\sum_{n=1}^N \\frac{\\delta(n)}{n}$ be $S(N)$.\n\n Let the greatest power of $2$ smaller or equal to $N$ be $2^k$. Then, $2^k \\leq N <2^{k+1}$ holds. Using the observation, we get the following equation:\n $\\sum_{n=1}^{2^k} \\frac{\\delta(n)}{n} = \\sum_{i=0}^{k-1} \\frac{2^{k-1-i}}{2^i} + \\frac{1}{2^k} = 2^{k-1}(\\frac{1-\\frac{1}{4^{k}}}{\\frac{3}{4}}) + \\frac{1}{2^k}$\n\n Now observe that for $2^k < n <2^{k+1}$, $\\frac{\\delta(n)}{n} = \\frac{\\delta(n-2^k)}{n-2^k}$. Therefore, we have that $S(N)= S(N-2^k)+ (\\frac{2^{k+1}}{3})(1-\\frac{1}{4^{k}}) + \\frac{1}{2^k}$\n\n Using this, we have that $S(N) - \\frac{2N}{3} = S(N-2^k) - \\frac{2(N-2^k)}{3} + \\frac{1}{3\\cdot 2^k}$\n\n Therefore, $|S(N) - \\frac{2N}{3}|\\leq \\sum_{k=0}^\\infty \\frac{1}{3\\cdot 2^k} \\leq 1$", "grading_guidelines": "(Partial)\n 1. Expressed $\\sum \\delta(n)/n$ as negative powers of 2's and attempted to rearrange the summation.\n(Almost)\n 1. Successfully rearranged the summation, and counted $2^{-k}$ correctly.", "problem_id": "PB-Basic-019", "level": "basic", "category": "Number theory", "source": "(translated) 2003 Korea Winter Program Practice Test", "max_score": 7, "difficulty": "IMO-easy", "short_answer": " "}12345678910#!/bin/sh# Reward measures structural submission validity only, not mathematical correctness.# External rubric-guided LLM judging against reference.json awards 0–7 points.# Offline, isolated Python; PROOF and VERIFIER_DIR allow local verification.set -euhere=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)export TESTS_DIR="$here" PROOF="${PROOF:-/app/proof.md}" VERIFIER_DIR="${VERIFIER_DIR:-/logs/verifier}"mkdir -p "$VERIFIER_DIR"printf '0\n' > "$VERIFIER_DIR/reward.txt"python3 -I -S "$here/grade_task.py"1234567# PB-Basic-020
Solve the following problem using your own reasoning and local tools. Do not use web lookups or external models. Write a complete, self-contained, rigorous mathematical proof to `/app/proof.md`; create `/app` if necessary.
## Problem
Find all pairs of primes $(a, b)$ such that $a^2 - ab - b^3 = 1$.tasks/pb-basic-011/tests/test.shAdded+10
tasks/pb-basic-012/instruction.mdAdded+26
tasks/pb-basic-012/solution/solve.shAdded+7
tasks/pb-basic-012/task.tomlAdded+20
tasks/pb-basic-012/tests/grade_task.pyAdded+58
tasks/pb-basic-012/tests/reference.jsonAdded+12
tasks/pb-basic-012/tests/test.shAdded+10
tasks/pb-basic-013/instruction.mdAdded+7
tasks/pb-basic-013/solution/solve.shAdded+15
tasks/pb-basic-013/task.tomlAdded+20
tasks/pb-basic-013/tests/grade_task.pyAdded+58
tasks/pb-basic-013/tests/reference.jsonAdded+12
tasks/pb-basic-013/tests/test.shAdded+10
tasks/pb-basic-014/instruction.mdAdded+7
tasks/pb-basic-014/solution/solve.shAdded+7
tasks/pb-basic-014/task.tomlAdded+20
tasks/pb-basic-014/tests/grade_task.pyAdded+58
tasks/pb-basic-014/tests/reference.jsonAdded+12
tasks/pb-basic-014/tests/test.shAdded+10
tasks/pb-basic-015/instruction.mdAdded+7
tasks/pb-basic-015/solution/solve.shAdded+9
tasks/pb-basic-015/task.tomlAdded+20
tasks/pb-basic-015/tests/grade_task.pyAdded+58
tasks/pb-basic-015/tests/reference.jsonAdded+12
tasks/pb-basic-015/tests/test.shAdded+10
tasks/pb-basic-016/instruction.mdAdded+9
tasks/pb-basic-016/solution/solve.shAdded+13
tasks/pb-basic-016/task.tomlAdded+20
tasks/pb-basic-016/tests/grade_task.pyAdded+58
tasks/pb-basic-016/tests/reference.jsonAdded+12
tasks/pb-basic-016/tests/test.shAdded+10
tasks/pb-basic-017/instruction.mdAdded+7
tasks/pb-basic-017/solution/solve.shAdded+7
tasks/pb-basic-017/task.tomlAdded+20
tasks/pb-basic-017/tests/grade_task.pyAdded+58
tasks/pb-basic-017/tests/reference.jsonAdded+12
tasks/pb-basic-017/tests/test.shAdded+10
tasks/pb-basic-018/instruction.mdAdded+7
tasks/pb-basic-018/solution/solve.shAdded+9
tasks/pb-basic-018/task.tomlAdded+20
tasks/pb-basic-018/tests/grade_task.pyAdded+58
tasks/pb-basic-018/tests/reference.jsonAdded+12
tasks/pb-basic-018/tests/test.shAdded+10
tasks/pb-basic-019/instruction.mdAdded+10
tasks/pb-basic-019/solution/solve.shAdded+18
tasks/pb-basic-019/task.tomlAdded+20
tasks/pb-basic-019/tests/grade_task.pyAdded+58
tasks/pb-basic-019/tests/reference.jsonAdded+12
tasks/pb-basic-019/tests/test.shAdded+10
tasks/pb-basic-020/instruction.mdAdded+7