Page 1 of 1

1566 - John

Posted: Fri Sep 05, 2014 12:36 am
by brianfry713
Use this thread to discuss this problem.

Re: 1566 - John

Posted: Sun Feb 11, 2018 4:06 am
by metaphysis
Test data generator.

Code: Select all

#include <ctime>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    srand(time(NULL));
    int cases = 1000;
    cout << cases << '\n';
    for (int c = 1; c <= cases; c++)
    {
        int n = rand() % 47 + 1;
        cout << n << '\n';
        for (int i = 1; i <= n; i++)
        {
            int m = rand() % 4747 + 1;
            if (i > 1) cout << ' ';
            if (rand() % 1000 < 300) cout << 1;
            else cout << m;
        }
        cout << '\n';
    }
    return 0;
}