preliminary updates

This commit is contained in:
Barrett Ruth 2025-11-04 22:10:42 -05:00
parent 1b0d5e4d77
commit cea90dbda5
2 changed files with 17 additions and 0 deletions

View file

@ -314,16 +314,25 @@ class AtcoderScraper(BaseScraper):
return return
data = await asyncio.to_thread(_scrape_problem_page_sync, category_id, slug) data = await asyncio.to_thread(_scrape_problem_page_sync, category_id, slug)
tests: list[TestCase] = data.get("tests", []) tests: list[TestCase] = data.get("tests", [])
combined_input = "\n".join(t.input for t in tests)
combined_expected = "\n".join(t.expected for t in tests)
print( print(
json.dumps( json.dumps(
{ {
"problem_id": letter, "problem_id": letter,
"combined": {
"input": combined_input,
"expected": combined_expected,
},
"tests": [ "tests": [
{"input": t.input, "expected": t.expected} for t in tests {"input": t.input, "expected": t.expected} for t in tests
], ],
"timeout_ms": data.get("timeout_ms", 0), "timeout_ms": data.get("timeout_ms", 0),
"memory_mb": data.get("memory_mb", 0), "memory_mb": data.get("memory_mb", 0),
"interactive": bool(data.get("interactive")), "interactive": bool(data.get("interactive")),
"multi_test": False,
} }
), ),
flush=True, flush=True,

View file

@ -231,14 +231,22 @@ class CodeChefScraper(BaseScraper):
memory_mb = 256.0 memory_mb = 256.0
interactive = False interactive = False
combined_input = "\n".join(t.input for t in tests)
combined_expected = "\n".join(t.expected for t in tests)
return { return {
"problem_id": problem_code, "problem_id": problem_code,
"combined": {
"input": combined_input,
"expected": combined_expected,
},
"tests": [ "tests": [
{"input": t.input, "expected": t.expected} for t in tests {"input": t.input, "expected": t.expected} for t in tests
], ],
"timeout_ms": timeout_ms, "timeout_ms": timeout_ms,
"memory_mb": memory_mb, "memory_mb": memory_mb,
"interactive": interactive, "interactive": interactive,
"multi_test": False,
} }
tasks = [run_one(problem_code) for problem_code in problems.keys()] tasks = [run_one(problem_code) for problem_code in problems.keys()]