NOIP2014生活大爆炸版石头剪子布【Pascal】

对于正常的N提高组选手来说,水过拿分就好=。=

<span style="font-size:18px;">var
    n,l1,l2,ans1,ans2    :longint;
    i,j,k                :longint;
    a,b                  :array[0..210] of longint;
    map                  :array[0..7,0..7] of boolean;
begin
   map[0,2]:=true;map[0,3]:=true;
   map[1,3]:=true;
   map[2,4]:=true;
   map[3,4]:=true;
   read(n,l1,l2);
   for i:=1 to l1 do read(a[i]);
   for i:=1 to l2 do read(b[i]);
   j:=1;k:=1;
   for i:=1 to n do 
   begin
      if (a[j]<>b[k]) then
      begin
         if (a[j]<b[k]) then
         begin
            if map[a[j],b[k]] then inc(ans1) else inc(ans2);
         end else
         begin
            if map[b[k],a[j]] then inc(ans2) else inc(ans1);
         end;
      end;
      j:=j mod l1+1;
      k:=k mod l2+1;
   end;
   writeln(ans1,' ',ans2); 
end.</span>
——by Eirlys

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值