/ Vijos / 讨论 / Vijos /

求助Spoj 3. Substring Check (Bug Funny)

const
a:array[1..10]of integer=(1,2,4,8,16,32,64,128,256,512);
var
c:char;
i,j,tot,tt:longint;
f:boolean;
begin
while not eof do
begin
tot:=0; tt:=0;
for i:=10 downto 1 do
begin
read(c);
if c='1'then inc(tot,a[i]);
end;
read(c);
for i:=5 downto 1 do
begin
read(c);
if c='1'then inc(tt,a[i]);
end;
f:=false;
for i:=1 to 5 do
begin
if tot mod 32=tt then begin f:=true; break;end;
tot:=tot shr 1;
end;
if f then writeln(1)else writeln(0);
end;
end.
//为何不可用Free Pascal!!!!

1 条评论

  • @ 2013-02-23 13:24:26

    谁说不能用FP

  • 1