Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

贴数据生成器!

Posted by 18357 at 2014-09-25 10:15:04 on Problem 1947
In Reply To:贴题解! Posted by:18357 at 2014-09-25 10:06:42
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#define N 10
using namespace std;
int main()
{
	freopen("test.in","w",stdout);
	int i,j,k;
	int n,m,p;
	int a,b,c;
	srand((unsigned)time(NULL));
	n=rand()%N+1;
	printf("%d %d\n",n,rand()%n+1);
	for(i=2;i<=n;i++)
	{
		printf("%d %d\n",rand()%(i-1)+1,i);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator