langningc2009's blog

By langningc2009, history, 15 months ago, In English

CPH-NG Main Interface

CPH-NG Main Interface — A Modern Competitive Programming Environment

A VSCode extension optimized for competitive programming, significantly boosting your efficiency

Smart test data management | 21 detailed verdict statuses | Special Judge support | Automated Compare with Brute Force

Why Choose CPH-NG?

The traditional CPH (Competitive Programming Helper) provides basic support for competitive programming, but still has several pain points in practice:

  • Insufficient bulk test data management – cannot efficiently handle large volumes of test cases
  • Limited verdict information – makes it difficult to pinpoint error types and causes
  • No Special Judge (SPJ) support – cannot handle multiple-solution problems or special judging requirements
  • Lack of intelligent compile caching – repeated compilations waste time
  • Rigid configuration options – low customizability for different use cases
  • Distracting interface features – online user count, donation banners, etc. reduce focus

CPH-NG’s Innovative Solutions

As a next-generation tool optimized for competitive programming, CPH-NG builds upon the original while introducing a wide range of innovative features and flexible configurations.

Key Features

Smart Test Data Management

Test Data Management

Multiple data import options – making test case management simple and efficient

CPH-NG offers flexible ways to import test data:

  • Archive parsing: automatically extract and match test cases from .zip archives
  • Directory import: auto-detect and pair input/output files
  • Competitive Companion integration: one-click import from your browser
  • Smart file matching: auto-match output files when selecting inputs manually
  • Compare with Brute Force imports: automatically capture failing test cases during brute-force comparisons
  • Inline data: detect embedded data formats inside C++ files for easy sharing
  • Manual entry: directly input custom test data in the interface

Intelligent Compilation System

The intelligent compilation system optimizes all C++ source files:

  • Hash detection: automatically checks file changes via hashing
  • Smart caching: recompiles only when changes are detected
  • Manual control: hold Ctrl to force recompile, Alt to skip
  • Multi-file support: applies to problem code, SPJ code, etc.

Fine-Grained Verdict System

Verdict System

21 detailed verdict types – pinpointing issues with precision

CPH-NG implements 21 distinct verdicts, offering 7× the precision of traditional CPH to help you quickly identify problems.

Special Judge (SPJ) Support

SPJ Config

Full testlib framework support – handling multiple-solution problems

Features include:

  • Multiple-solution handling: supports constructive/permutation problems with multiple valid answers
  • Floating-point control: precise handling of floating-point comparisons in geometry/numerical problems
  • Interactive problems: supports tasks requiring program–judge interaction

Smart Output

Smart Output

Colored output and automatic long-output file handling

  • Colored output: ANSI escape sequences for better readability
  • Long output redirection: automatically stores long outputs into files

Automated Compare with Brute Force

Brute Force Comparison

Automated Compare with Brute Force – verifying correctness with confidence

This feature runs your solution side by side with a brute-force solution (a simple but correct reference implementation), generating random tests until a discrepancy is found.

It provides a complete workflow:

  • Generator integration: supports custom random data generators
  • Reference solution comparison: compares against brute force or standard solutions
  • Failing test capture: automatically saves failing inputs when outputs differ
  • Batch validation: validate with large-scale randomized data

Flexible Configuration

Config UI

Rich configuration options – adaptable to various use cases

  • Compiler settings: custom paths, flags, and optimizations
  • Runtime policies: configure timeouts and performance monitoring
  • Output comparison: customize OLE length, PE whitespace handling, etc.
  • UI customization: multiple languages, light/dark themes

Data Persistence

Seamless work state saving:

  • Test case caching: all data and results persist across sessions
  • Session recovery: automatically restores test states when reopening files
  • Project-level isolation: each source file maintains its own test environment

Technical Advantages

Feature Comparison

Feature Traditional CPH CPH-NG Improvement
Verdict precision Basic verdicts 21 detailed states 7× more precise debugging
SPJ support No Full testlib SPJ Multi-solution & interactive support
Performance monitor Basic timing Millisecond accuracy Detailed profiling and bottleneck ID
Data management Manual Smart bulk import 10× faster handling
Compilation Always rebuild Hash-based caching 90% compile time saved
Automated validation None Compare with Brute Force Automated correctness verification
Config flexibility Fixed Rich configurations Fits multiple workflows
Persistence No state saving Full persistence Seamless state recovery

Quick Start

Installation

  1. One-click install: Open in VSCode
  2. Marketplace: search CPH NG in VSCode Extensions
  3. Offline install: download .vsix from GitHub Actions
  4. Build from source: clone repo and build manually

Basic Workflow

  1. Create problem: use Ctrl+Alt+B inside a C/C++ file
  2. Import test cases: add single or bulk data through the UI
  3. Run tests: execute/stop tests via Ctrl+Alt+B
  4. Analyze results: check verdicts, runtime, and errors

Advanced Configurations

Advanced Config
Unlock the full potential of CPH-NG with advanced settings

  • SPJ setup: specify Special Judge program in config
  • Compare with Brute Force setup: set generator and brute-force solution for automated validation
  • Compiler options: customize C/C++ flags and optimizations
  • UI customization: configure language, theme, and verdict display

Project Info & Community

Project Status

Contribution

Vision

CPH-NG aims to provide a professional, efficient tool for competitive programming. Through continuous innovation and community collaboration, it enhances the coding experience so programmers can focus on algorithms, not tooling limitations.


Start using CPH-NG today and experience a professional competitive programming environment!

  • Vote: I like it
  • +39
  • Vote: I do not like it

| Write comment?
»
15 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Please add support to test solution for interactive problems. That'll be much helpful.

»
9 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Please add support for graders. That'll be very helpful :)

»
9 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Noiceeee you deserve an upvote from me Amazing!