比赛 20091112练习 评测结果 AAAAA
题目名称 个人所得税 最终得分 100
用户昵称 ZhouZn1 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-11-12 12:11:38
显示代码纯文本
program personaltax;
var

x:array[1..50000,1..12]of longint;
n,a,b,tx,ty,tz:longint;
s:real;
st,stt:char;
procedure ycx(nn:real);
begin
 if nn<=4000 then nn:=nn-800 else nn:=nn*0.8;
 if nn<=20000 then s:=s+nn*0.2
  else
  begin
   s:=s+20000*0.2;
   nn:=nn-20000;
   if nn<=30000 then s:=s+nn*0.3
   else
   begin
    s:=s+30000*0.3;
    nn:=nn-30000;
    s:=s+nn*0.4;
   end;
  end;
end;
procedure ys(nn:real);
begin
 nn:=nn-800;
 if nn<=500 then s:=s+nn*0.05
 else
  begin
   s:=s+500*0.05;
   nn:=nn-500;
   if nn<=1500 then s:=s+nn*0.1
   else
    begin
     s:=s+1500*0.1;
     nn:=nn-1500;
     if nn<=3000 then s:=s+nn*0.15
     else
      begin
       s:=s+3000*0.15;
       nn:=nn-3000;
       if nn<=15000 then s:=s+nn*0.2
       else
        begin
         s:=s+15000*0.2;
         nn:=nn-15000;
         if nn<=20000 then s:=s+nn*0.25
         else
          begin
           s:=s+20000*0.25;
           nn:=nn-20000;
           if nn<=20000 then s:=s+nn*0.3
           else
            begin
             s:=s+20000*0.3;
             nn:=nn-20000;
             if nn<=20000 then s:=s+nn*0.35
              else
               begin
                s:=s+20000*0.35;
                nn:=nn-20000;
                 if nn<=20000 then s:=s+nn*0.4
                  else
                   begin
                    s:=s+20000*0.4;
                    nn:=nn-20000;
                    s:=s+nn*0.45;
                   end;
               end;
            end;
          end;
        end;
      end;
    end;
  end;
end;
begin
assign(input,'personaltax.in');assign(output,'personaltax.out');
reset(input);rewrite(output);
readln(n);
read(st);
while true do
 begin
  if st='#' then break;
  if st='P' then while stt<>'Y' do read(stt);
  if st='I' then while stt<>'E' do read(stt);
  read(tx);
  repeat read(stt);until (stt>='0')and(stt<='9');
  ty:=0;
  ty:=ty+ord(stt)-48;
  read(stt);
  if stt<>'/' then begin ty:=ty*10;ty:=ty+ord(stt)-48;end;
  while stt<>' ' do read(stt);
  readln(tz);
  if st='P' then inc(x[tx,ty],tz);
  if st='I' then if tz>800 then ycx(tz);

 read(st);
 end;

for a:=1 to n do
 for b:=1 to 12 do
  if x[a,b]>800 then ys(x[a,b]);

writeln(s:0:2);
close(input);close(output);
end.