From 127de3d6a5ec4d83db4c2a8ace2fdd25bba9132d Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 4 Nov 2025 23:39:43 -0500 Subject: [PATCH] fix --- doc/cp.nvim.txt | 12 ++++++++---- lua/cp/ui/views.lua | 7 +++++++ scrapers/atcoder.py | 5 +++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/cp.nvim.txt b/doc/cp.nvim.txt index 879bc5d..f99b07b 100644 --- a/doc/cp.nvim.txt +++ b/doc/cp.nvim.txt @@ -40,15 +40,17 @@ COMMANDS *cp-commands* Execution modes: • :CP run Combined: single execution with all tests + (auto-switches to individual when multiple samples) • :CP run all Individual: N separate executions • :CP run n Individual: run test n only • :CP run n,m,... Individual: run specific tests (e.g. nth and mth) --debug: Use debug build (builds to build/.dbg) - Combined mode mimics platform behavior in order to accurately - simulate online judge environments. Individual mode provides - per-test verdicts. + Combined mode runs all test inputs in one execution (matching + platform behavior for multi-test problems). When a problem has + multiple independent sample test cases, :CP run auto-switches to + individual mode to run each sample separately. Examples: > :CP run " Combined: all tests, one execution @@ -556,18 +558,20 @@ Execution Modes ~ The I/O view supports two execution modes: -Combined Mode (default: :CP run) +Combined Mode (:CP run with single sample) • Single execution with all test inputs concatenated • Matches platform behavior (e.g. Codeforces multi-test format) • Shows one verdict for the entire execution • Input split: All test inputs concatenated • Output split: Single program output + verdict + • Used when problem has one sample containing multiple test cases Individual Mode (:CP run all / :CP run n / :CP run n,m,...) • Separate execution for each test case • Per-test verdicts for debugging • Input split: Selected test inputs concatenated • Output split: All test outputs concatenated + per-test verdicts + • Auto-selected when problem has multiple independent samples Layout ~ diff --git a/lua/cp/ui/views.lua b/lua/cp/ui/views.lua index b12509c..a52779e 100644 --- a/lua/cp/ui/views.lua +++ b/lua/cp/ui/views.lua @@ -358,6 +358,13 @@ function M.run_io_view(test_indices_arg, debug, mode) return end + if mode == 'combined' then + local test_cases = cache.get_test_cases(platform, contest_id, problem_id) + if test_cases and #test_cases > 1 then + mode = 'individual' + end + end + M.ensure_io_view() local run = require('cp.runner.run') diff --git a/scrapers/atcoder.py b/scrapers/atcoder.py index 7d266d0..54ec6fc 100644 --- a/scrapers/atcoder.py +++ b/scrapers/atcoder.py @@ -71,7 +71,7 @@ def _retry_after_requests(details): on_backoff=_retry_after_requests, ) def _fetch(url: str) -> str: - r = _session.get(url, headers=HEADERS, timeout=TIMEOUT_SECONDS) + r = _session.get(url, headers=HEADERS, timeout=TIMEOUT_SECONDS, verify=False) if r.status_code in RETRY_STATUS: raise requests.HTTPError(response=r) r.raise_for_status() @@ -243,7 +243,8 @@ def _to_problem_summaries(rows: list[dict[str, str]]) -> list[ProblemSummary]: async def _fetch_all_contests_async() -> list[ContestSummary]: async with httpx.AsyncClient( - limits=httpx.Limits(max_connections=100, max_keepalive_connections=100) + limits=httpx.Limits(max_connections=100, max_keepalive_connections=100), + verify=False, ) as client: first_html = await _get_async(client, ARCHIVE_URL) last = _parse_last_page(first_html)