308 - Tin Cutter
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
308 - Tin Cutter
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: 308 - Tin Cutter
Test data generator.
Code: Select all
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(int argc, char * argv[])
{
srand(time(NULL));
for (int c = 1; c <= 100; c++)
{
int n = 30;
cout << n << '\n';
for (int i = 1; i <= n; i++)
{
if ((rand() % 2) == 1)
{
int x = rand() % 1000, y1 = rand() % 1000, y2 = rand() % 1000;
while (y2 == y1)
y2 = rand() % 1000;
cout << x << ' ' << y1 << ' ' << x << ' ' << y2 << '\n';
}
else
{
int y = rand() % 1000, x1 = rand() % 1000, x2 = rand() % 1000;
while (x2 == x1)
x2 = rand() % 1000;
cout << x1 << ' ' << y << ' ' << x2 << ' ' << y << '\n';
}
}
}
cout << "0\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.