Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
再发个更强的gen....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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator