[Tool] stress.ojcloud.net — a free online stress tester
Разница между en3 и en4, 9 символ(ов) изменены
**TL;DR:** I built **[stress.ojcloud.net](https://stress.ojcloud.net)** — a free online stress tester for competitive programmers. Paste your `main`, `brute`, and `gen` into three tabs, hit Run, and it streams per-test verdicts and stops at the first counterexample with `Input / Main Output / Brute Output` side-by-side. No signup, no install, 8 languages (C++ 03/11/14/17/20, C, Python/PyPy, Java, Kotlin, Go, Rust).↵

[cut]↵

## Hello, Codeforces!↵

If you've been doing CP for more than a week, you already know the routine. You submit, you get `Wrong answer on pretest 2`, the test is hidden, and your solution is 300 lines long. You open a terminal, `mkdir stress`, write the same `while true; do ./gen > in; ./a.out < in > out1; ./brute < in > out2; diff out1 out2 || break; done` you've written a hundred times, realize you forgot to seed the generator, rewrite it, forget to recompile `brute`, finally see a diff, and now you're squinting at 2000 random numbers trying to minimize the counterexample by hand.↵

We all do it. tourist does it, Um_nik does it, I do it. Stress testing is probably the single most valuable debugging skill in CP, and yet every single one of us has hand-rolled the same bash script a hundred times.↵

## The friction with the bash approach↵

- Boilerplate every single time: compile three files, seed loop, diff, break.↵
- No UI. You can't see which test is running or how far along you are.↵
- Switching languages (Python brute, C++ main) means rewriting the runner.↵
- No history. Close the terminal, lose everything.↵
- Sharing a counterexample with a teammate means pasting 3 files into Discord.↵
- Forget to `-O2` the brute and it takes 40 seconds per test. Forget to seed the RNG and every test is identical.↵

I got tired of this, so I built something.↵

## What stress.ojcloud.net does↵

- **8 languages:** C++ 03/11/14/17/20, C, Python 3, PyPy 3, Java, Kotlin, Go, Rust. Switch from a dropdown; templates auto-load.↵
- **5 built-in generator snippets:** Array, Tree, Graph, String, Grid — one click drops working code into the `gen` tab. Each snippet uses a `random(lo, hi)` helper and a seed from `argv[1]`, so runs are reproducible.↵
- **Real-time verdicts:** the right panel streams `Test 1 → Test 2 → …` live. Stops the moment it finds a mismatch — no waiting for the remaining 900 tests.↵
- **Counterexample card:** shows `Input`, `Main Output`, `Brute Output` side-by-side with one-click copy on each.↵
- **Configurable tests & timeout:** default 200 tests / 2s per test, tune to taste.↵
- **Browser-resumable session:** close the tab mid-run, reopen it, your code and last result are still there.↵
- **7-language UI:** English / Tiếng Việt / Русский / 简体中文 / 日本語 / 한국어 / Português.↵
- **Free. No signup. No account. No email.** Just open the page and paste.↵

## Demo: finding a real bug in ~30 seconds↵

Let's do the most classic bug in CP — Kadane's on max subarray sum, with `best = 0` instead of `LLONG_MIN`. Invisible on positive inputs, fatal on all-negative ones.↵

**`main` (buggy O(n) Kadane):**↵

```cpp↵
#include <bits/stdc++.h>↵
using namespace std;↵
int main() {↵
    int n; cin >> n;↵
    vector<long long> a(n);↵
    for (auto& x : a) cin >> x;↵
    long long best = 0, cur = 0;          // BUG: should be LLONG_MIN↵
    for (long long x : a) {↵
        cur = max(x, cur + x);↵
        best = max(best, cur);↵
    }↵
    cout << best << "\n";↵
}↵
```↵

**`brute` (O(n²), definitely correct):**↵

```cpp↵
#include <bits/stdc++.h>↵
using namespace std;↵
int main() {↵
    int n; cin >> n;↵
    vector<long long> a(n);↵
    for (auto& x : a) cin >> x;↵
    long long best = LLONG_MIN;↵
    for (int i = 0; i < n; i++) {↵
        long long s = 0;↵
        for (int j = i; j < n; j++) { s += a[j]; best = max(best, s); }↵
    }↵
    cout << best << "\n";↵
}↵
```↵

**`gen`:** click the **Array** snippet, tweak the range to `random(1, 8)` and `random(-10, 10)` so negatives actually appear. Hit **Run**.↵

Within a few tests the stream stops on:↵

```↵
Input          Main Output    Brute Output↵
2              0              -3↵
-3 -5↵
```↵

There's the bug. All-negative array, buggy Kadane returns `0`, correct answer is `-3`. Fix the init to `LLONG_MIN`, re-run, green "All 200 tests passed". Total time: under a minute.↵

## Try it↵

**[stress.ojcloud.net](https://stress.ojcloud.net)** — open the page, paste 3 files, hit Run. That's it. No signup flow to click through.↵

If you prefer a walkthrough, here's a 30-second video covering the exact Kadane example above: **[youtu.be/XI1HNegwFuI](https://www.youtube.com/watch?v=XI1HNegwFuI)**.↵

## Feedback / bug reports / feature requests↵

I'd love to hear what breaks, what's missing, and what languages/snippets you'd want next. Join the Discord: **[discord.gg/pg52FspEns](https://discord.gg/pg52FspEns)** — share counterexamples, report bugs, argue about generators.↵

## Thanks↵

Huge thanks to [user:MikeMirzayanov,2026-04-07] — the checker design for OJCloud's main judge was shaped heavily by `testlib.h`, and the same philosophy (strict, readable, reproducible) carried over into this stress runner. And thanks to the countless CF blogs over the years that taught everyone the `gen / main / brute / diff` pattern in the first place — this tool is just that pattern with a UI bolted on.↵

Happy stressing.↵

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский ZhangShan 2026-04-07 16:31:12 9 Tiny change: 'Rust).\n\n[cut]\n\n## Hel' -> 'Rust).\n\n## Hel'
en3 Английский ZhangShan 2026-04-07 13:44:11 0 (published)
en2 Английский ZhangShan 2026-04-07 13:30:48 0 (saved to drafts)
en1 Английский ZhangShan 2026-04-07 13:30:22 5416 Initial revision (published)