比赛 |
“Asm.Def战记之拉格朗日点”杯 |
评测结果 |
AAAEWEEAEE |
题目名称 |
Asm.Def的微小贡献 |
最终得分 |
40 |
用户昵称 |
Ten.X |
运行时间 |
0.200 s |
代码语言 |
Pascal |
内存使用 |
0.17 MiB |
提交时间 |
2015-11-04 11:23:24 |
显示代码纯文本
var iiiii,iiii,iii,ii,i,n:longint;a:array[1..1005]of longint;
begin
assign(input,'asm_contribute.in');
assign(output,'asm_contribute.out');
reset(input);
rewrite(output);
read(n);
if n<=5 then begin writeln(2);write('1 2');halt;end;
if (n>5) and(n<=50) then begin
for i:=1 to n do read(a[i]);
for i:=2 to n do
for ii:=i-1 downto 1 do
if a[i]=a[ii] then begin writeln(2);write(ii,' ',i);halt;end;
for i:=3 to n do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
if a[i] xor a[ii] xor a[iii]=0 then begin writeln(3);write(iii,' ',ii,' ',i);halt;end;
for i:=4 to n do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
for iiii:=i-3 downto 1 do
if a[i] xor a[ii] xor a[iii] xor a[iiii]=0 then begin writeln(4);write(iiii,' ',iii,' ',ii,' ',i);halt;end;
for i:=5 to n do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
for iiii:=i-3 downto 1 do
for iiiii:=i-4 downto 1 do
if a[i] xor a[ii] xor a[iii] xor a[iiii] xor a[iiiii]=0 then begin writeln(5);write(iiiii,' ',iiii,' ',iii,' ',ii,' ',i);halt;end;
end;
if n>50 then begin for i:=1 to 50 do read(a[i]);
for i:=2 to 50 do
for ii:=i-1 downto 1 do
if a[i]=a[ii] then begin writeln(2);write(ii,' ',i);halt;end;
for i:=3 to 50 do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
if a[i] xor a[ii] xor a[iii]=0 then begin writeln(3);write(iii,' ',ii,' ',i);halt;end;
for i:=4 to 50 do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
for iiii:=i-3 downto 1 do
if a[i] xor a[ii] xor a[iii] xor a[iiii]=0 then begin writeln(4);write(iiii,' ',iii,' ',ii,' ',i);halt;end;
for i:=5 to 50 do
for ii:=i-1 downto 1 do
for iii:=i-2 downto 1 do
for iiii:=i-3 downto 1 do
for iiiii:=i-4 downto 1 do
if a[i] xor a[ii] xor a[iii] xor a[iiii] xor a[iiiii]=0 then begin writeln(5);write(iiiii,' ',iiii,' ',iii,' ',ii,' ',i);halt;end;
end;
close(input);
close(output);
end.