CPH-NG: Next-Generation Competitive Programming Helper
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
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
.ziparchives - 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
Ctrlto force recompile,Altto skip - Multi-file support: applies to problem code, SPJ code, etc.
Fine-Grained 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
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
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
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
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
- One-click install: Open in VSCode
- Marketplace: search
CPH NGin VSCode Extensions - Offline install: download
.vsixfrom GitHub Actions - Build from source: clone repo and build manually
Basic Workflow
- Create problem: use
Ctrl+Alt+Binside a C/C++ file - Import test cases: add single or bulk data through the UI
- Run tests: execute/stop tests via
Ctrl+Alt+B - Analyze results: check verdicts, runtime, and errors
Advanced Configurations
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
- GitHub Repo: langningchen/cph-ng
- Release status: officially released, continuously updated Latest Release
- Maintenance: actively developed with regular improvements Latest Commit
- Support: GitHub Issues GitHub Issues
Contribution
- Report issues: GitHub Issues
- Community discussions: GitHub Discussions
- Code contributions: PRs welcome!
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!



