1566 - John
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
1566 - John
Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!
-
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
Re: 1566 - John
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;
}
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.