/ SB域 /

记录详情

Accepted

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 16ms 10.98 MiB
#2 Accepted 19ms 11.0 MiB
#3 Accepted 16ms 11.062 MiB
#4 Accepted 19ms 11.0 MiB
#5 Accepted 16ms 11.0 MiB
#6 Accepted 18ms 11.0 MiB
#7 Accepted 16ms 10.98 MiB
#8 Accepted 21ms 11.0 MiB
#9 Accepted 18ms 11.125 MiB
#10 Accepted 16ms 11.086 MiB

代码

const maxn=1000000;
var u:array[1..10000000]of boolean;
    s:array[0..10000000]of int64;
    i,m,x1,y1,x2,y2:longint;
    now:int64;
Procedure prime(n:longint);
  var i,j:longint;
begin
  for i:=2 to n do
    if not u[i] then begin
      j:=i+i;
      while j<=n do begin
        u[j]:=true;
        inc(j,i);
      end;
    end;
end;
begin
  prime(maxn);
  s[1]:=0; s[2]:=0;
  now:=0;
  for i:=3 to maxn do begin
   if u[i]=false then inc(now);
   s[i]:=now;
  end;
  readln(m);
  for i:=1 to m do begin
  readln(x1,y1,x2,y2);
  writeln((s[x2]-s[x1-1])*(s[y2]-s[y1-1])) ;
  end;
  close(input);
  close(output);
end.

信息

递交者
类型
递交
题目
哥德巴赫矩阵
题目数据
下载
语言
Pascal
递交时间
2017-08-22 22:13:17
评测时间
2017-08-22 22:13:17
评测机
分数
100
总耗时
180ms
峰值内存
11.125 MiB