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

再发个更强的gen....

Posted by ZhangChi at 2007-07-12 17:18:57 on Problem 2987
In Reply To:不知道这个题的数据是怎样的...排名第一的程序用我的数据测至少也要1.5s....管理员用我的gen生成数据把!!! Posted by:ZhangChi at 2007-07-12 17:05:31
program ex;

var
	N , M	:	longint;
	a , b	:	longint;
	i	:	longint;

begin
	assign ( output , 'G.in' ) ; rewrite ( output );
	randomize;
	N := 5000 ; M := 60000;
	writeln ( N , ' ' , M );
	for i := 1 to N do writeln ( random ( 20000000 ) - 10000000 );
	for i := 1 to M - N + 1 do
	begin
		repeat
			a := random ( N - 1 ) + 2;
			b := random ( a - 1 ) + 1;
		until a <> b;
		writeln ( a , ' ' , b );
	end;
        for i := 1 to N - 1 do writeln ( i , ' ' , i + 1 );
	close ( output );
end.

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