/ SB域 /

记录详情

Compile Error

foo.pas(56,12) Error: Identifier not found "outp"
foo.pas(56,12) Fatal: Syntax error, ")" expected but "end of file" found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

代码

var a,b,c,s,p,i,j,cnt,kk:longint;
    w:array[0..65536,0..160]of longint;
    u:array[0..65536]of boolean;
    ans:array[0..16000]of char;
    t:array[0..16000]of longint;
procedure swap(var a,b:longint);
var
t:longint;
begin
 t:=a; a:=b; b:=t;
end;
procedure f(s,p:longint);
var len,i:longint;

begin
 len:=0;
 fillchar(t,sizeof(t),0);
 // write(s,'=');
 while s>=1 do begin
  inc(len);
  if s mod 2=0 then t[len]:=0
       else t[len]:=1;
  s:=s div 2;
 end;
 for i:=1 to 16 div 2 do
  swap(t[i],t[16-i+1]);
 for i:=1 to 16 do w[p,i]:=t[i];

end;
begin
 readln(a,b,c,s);
 fillchar(u,sizeof(u),false);
 u[s]:=true;
 p:=1;
 f(s,p);
 while true do begin
   s:=(a*s+b) mod c;
   if u[s] then break;
   u[s]:=true;
   inc(p);
   f(s,p);
 end;
 for i:=1 to 16 do begin
  cnt:=0;
  for j:=1 to p do begin
  cnt:=cnt+w[j,i];
  end;
  inc(kk);
  if cnt=0 then ans[kk]:='0'
  else if cnt=p then ans[kk]:='1'
  else ans[kk]:='?'
 end;
 for i:=1 to kk do write(ans[i]);
 writeln;
 close(input);
 close(outp

信息

递交者
类型
递交
题目
Persistent Bits连续位
题目数据
下载
语言
Pascal
递交时间
2017-08-22 15:10:08
评测时间
2017-08-22 15:10:08
评测机
分数
0
总耗时
25ms
峰值内存
9.203 MiB