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

什么情况?暴力枚举m也能过?我只能说数据太水!!!

Posted by 1017981912 at 2014-11-29 09:16:52 on Problem 2769
附代码,我觉得有漏洞的样子,呵呵:
const
        maxsin=99999;
var
        hash:array[0..maxsin] of boolean;
        sin:array[1..300] of longint;
        i,j,t,g,k,te:longint;
begin
        readln(t);
        for k:=1 to t do
        begin
                readln(g);
                for i:=1 to g do readln(sin[i]);
                for i:=1 to maxsin do
                begin
                        fillchar(hash,sizeof(boolean)*i,false);
                        te:=0;
                        for j:=1 to g do
                        begin
                                if hash[sin[j] mod i] then
                                begin
                                        te:=j;
                                        break;
                                end;
                                hash[sin[j] mod i]:=true;
                        end;
                        if te=0 then
                        begin
                                writeln(i);
                                break;
                        end;
                end;
        end;
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