PersonalCorpus 版 (精华区)

153707 08:13:18 4 Mar 2002
Bozhang,HIT,P.R.China 1021 Pascal Accepted 0.06 sec 114K


var
    a:array[-32768..32767] of boolean;
    i,n:integer;
begin
    fillchar(a,sizeof(a),0);
    readln(n);
    while n>0 do begin dec(n); readln(i); a[i]:=true end;
    readln(n);
    while n>0 do begin
        dec(n); readln(i);
        if i>=10000 then begin
            if a[i-10000] then begin
                writeln('YES');
                halt;
            end;
          end else if i>-22768 then if a[10000-i] then begin
            writeln('YES');halt
        end;
    end;
    writeln('NO');
end.
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.417毫秒