Half of debugging a grid problem is having a grid to debug it with, and typing one out by hand is both slow and biased towards the cases you already thought of. The I/O Matrix Generator builds one to your dimensions, fills it four different ways, and prints it in the layout a judge expects.
The Prepend "N M" size line checkbox is the detail that saves the most time. Nearly every competitive problem reads the dimensions before the grid, so leaving it ticked means the block you paste is a complete stdin file rather than a body you still have to annotate.
Output appears twice: as a bordered table you can actually read, and as a monospace block ready to copy. Rows and columns are capped at 20 each and the values at plus or minus 1000, with typed values clamped rather than merely discouraged, because a 500 by 500 grid would lock the tab.
Getting a Test Grid Onto Your Clipboard
- Set Rows and Columns, then Min Val and Max Val for the random range. Entering them backwards is fine: the range is sorted before use, so 100 down to 1 behaves as 1 up to 100.
- Pick a Fill Mode. Random for a stress test, All Zeros for a blank canvas to edit, Identity for a matrix-multiplication sanity check, and Sequential when you need to see at a glance which cell is which.
- Choose an Output Format to match the problem statement rather than your preference.
- Press Generate Matrix. Nothing is produced until you do, and every press with Random selected gives a fresh grid, which is the point when you are hunting an intermittent failure.
- Check the table preview, then take the Copyable Output block below it.
Supported Formats for the Copyable Output
- Space-separated (row) puts one row per line with single spaces between values, the near-universal convention on Codeforces and similar judges.
- Comma-separated keeps the row structure but joins with commas, which is what you want when pasting into a C++ or Python array literal rather than into stdin.
- One per line flattens each row into a vertical run, for problems that read a single value at a time and ignore line structure entirely.
- Sequential numbers in row-major order starting from 1, so a 3 by 3 grid ends with 9 in the bottom-right corner and any transposition bug in your reader is immediately visible.
- Identity marks a cell whenever the row index equals the column index, so on a non-square grid you get a partial diagonal instead of an error.
- All Zeros ignores the min and max entirely, which makes it the fastest way to produce a blank grid of exact dimensions to edit by hand.