Блог пользователя brunomont

Автор brunomont, 4 месяца назад, По-английски

Testcase generation for random inputs.

Hello, Codeforces!

Here I introduce tgen, a single-header C++ library (similar to jngen) for generating random and adversarial testcases for competitive programming problems.

Open tgen on GitHub

Header link · Documentation

Tgen supports lists, permutations, graphs, trees, strings, math, geometry, and more. Here are some examples:

Examples

There is a robust framework for distinct generation:

Distinct examples

Another important feature is adversarial generation, that is, worst-case generation (a.k.a. hacks).

Hack examples

Most of which inspired by Codeforces blogs. There is a feature/time comparison against jngen here.

Give it a try next time you are prepairing a problem! If there are any issues or feature requests, please open an issue on GitHub, and I will sort it out as soon as I can.

Extra: tgen miniblogs

Over the next few weeks, I will post a series of miniblogs discussing interesting mathematical and algorithmic problems that came up during the development of tgen. Stay tuned!

Acknowledgments

I would like to thank Roberio for encouraging me to work on this project, and some friends for the help in discussions: emaneru, bernardo_amorim, rafaelgo, kobus, VinnySJ. Finally, I want to thank ifsmirnov for the inspiring jngen project.

  • Проголосовать: нравится
  • +134
  • Проголосовать: не нравится

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

prono is on fire 🔥

»
2 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Haven't try it yet but I can say that this will be sooo good