| ||||||||||
| 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 | |||||||||
什么情况?暴力枚举m也能过?我只能说数据太水!!!附代码,我觉得有漏洞的样子,呵呵:
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator