比赛 20101116 评测结果 WWTTTTWTTW
题目名称 长路上的灯 最终得分 0
用户昵称 mate 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-16 08:45:58
显示代码纯文本
program light(input,output);
var
        i,i1,j,k,n,t1,z1:longint;
        z:real;
        a:array[1..10000000] of real;
        b:array[1..10000000] of boolean;
        c:array[1..1000] of integer;
        t:array[1..10000000] of integer;

function change(z:real):longint;
var     i1:longint;
begin
        i1:=0;
        while i1<z do inc(i1);
        change:=i1;
end;{change}

begin
        assign(input,'light.in');
        reset(input);
        assign(output,'light.out');
        rewrite(output);

        readln(n);
        for i :=1 to n do
            readln(a[i],t[i]);
        close(input);

        k:=1;
        for i:=1 to n do writeln(a[i],' ',t[i]);
        fillchar(b,sizeof(b),false);
        for i:=1 to n do begin
            for j:=1 to t[i] do begin
                z:=int(a[i]*j);
                z1:=change(z);
                write('deng---->',z1,'        ');
                if z1>k then k:=z1;
                b[z1]:=not(b[z1]);
                for i1:=1 to k do write(b[i1]:8);
                writeln;
            end;
        end;{doit}
        t1:=0;
        for i:=1 to k do
            if b[i] then begin
                t1:=t1+1;
                c[t1]:=i;
            end;
        for i:=1 to t1 do writeln(c[i]);
        close(output);
end.