JuniorAlexander's blog

By JuniorAlexander, history, 3 hours ago, In English

Hi Codeforces!

While practicing I kept running into the same problem: AI assistants are great at handing you a full solution, and terrible at helping you learn. So I built the opposite: an open-source set of tools where you solve the problem, and the tools check your reasoning.

GitHub: https://github.com/juniorpat4/Stress_Testing

What it does

  • verify_limits.py: compiles your solution twice. A debug build with ASan, UBSan and _GLIBCXX_DEBUG catches out-of-bounds accesses and UB. A release build (-O2) measures real CPU time and memory against the TL/ML. Supports --eps for floating-point answers and --checker for problems with multiple valid answers.
  • stress_test.py: runs your solution against a brute force on random inputs until it finds a counterexample, then saves it to tests/ as a regression test.
  • Generators: arrays, graphs, and trees with random, line and star shapes. Random trees only have (log n) depth, so they never test deep recursion; the line shape does.
  • LeetCode support: your class Solution stays clean, and a test main() lives behind #ifdef LOCAL, so the same tools work for class-based problems.

All of these are plain Python + g++. They work without any AI, straight from your terminal.

The no-spoiler part

On top of that there are a few skills for Claude Code. When you paste a problem (text or a screenshot), it only sets up the folder and the samples, then waits. It never writes the solution unless you explicitly ask. Hints come in levels:

  • /structure and /techniques first list the candidates without saying which one works. You decide, then ask for the verdict.
  • /input gives you 3 tricky edge cases, with outputs computed by actually running a brute force (never by mental math).

Example

A Kadane solution with best = 0 passes the sample of CSES 1643, but the stress test breaks it on the second iteration:

✗ WA con seed 2 (iteración 2)
--- entrada ---
1
-8
--- esperado (brute) ---
-8
--- obtenido (sol) ---
0

(Messages are in Spanish for now; happy to translate if there's interest.)

Two things I learned while building it

  1. UB can pass in release. Calling front() on an empty deque returned OK on the samples with -O2, and was only caught by the debug build. Always run both.
  2. GCC 16 no longer includes <cassert> in <bits/stdc++.h>. If assert suddenly stops compiling locally, that's why. Older GCC versions on judges still include it.

Fair play

This is meant for practice and upsolving. Please follow Codeforces rules about AI use during rated contests.

Limitations

Linux + GCC only for now (it relies on <bits/stdc++.h>, _GLIBCXX_DEBUG and Linux-specific process accounting). No interactive problems yet.

Feedback, issues and PRs are very welcome!

»
115 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

we are finally getting some useful blogs(even if ai assisted) in recent actions, instead of getting whole recent action filled with "xxxx cheated in yyyy", guess codeforces is healing again and people finally understood that cheating have no solution so everyone should stfu.

  • »
    »
    112 minutes ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Yeaaaa. Please, test the skill and make your review :D