/ Randle /

记录详情

Compile Error

/in/foo.cc:9:16: error: too many decimal points in number
   prhash:array[1..max1] of longint;
                ^~~~~~~
/in/foo.cc:10:13: error: too many decimal points in number
   prs:array[1..max1] of longint;
             ^~~~~~~
/in/foo.cc:13:33: error: too many decimal points in number
   a0num,a1num,b0num,b1num:array[1..max1+4] of longint;
                                 ^~~~~~~
/in/foo.cc:14:15: error: too many decimal points in number
   temp2:array[1..4] of longint;
               ^~~~
/in/foo.cc:15:14: error: too many decimal points in number
   temp:array[1..4] of big;
              ^~~~
/in/foo.cc:1:1: error: 'uses' does not name a type
 uses math;
 ^~~~
/in/foo.cc:2:1: error: 'type' does not name a type
 type
 ^~~~
/in/foo.cc:5:7: error: 'end' does not name a type; did you mean 'enum'?
       end;
       ^~~
       enum
/in/foo.cc:7:3: error: 'max1' does not name a type
   max1=(trunc(sqrt(2000000000))+1);
   ^~~~
/in/foo.cc:8:1: error: 'var' does not name a type; did you mean 'char'?
 var
 ^~~
 char
/in/foo.cc:10:6: error: found ':' in nested-name-specifier, expected '::'
   prs:array[1..max1] of longint;
      ^
/in/foo.cc:10:3: error: 'prs' does not name a type
   prs:array[1..max1] of longint;
   ^~~
/in/foo.cc:11:3: error: 'prnum' does not name a type; did you mean 'enum'?
   prnum,i,j,maxx,minx,k:longint;
   ^~~~~
   enum
/in/foo.cc:12:3: error: 'a0' does not name a type
   a0,a1,b0,b1,biga0,biga1,bigb0,bigb1,n,ans,x:longint;
   ^~
/in/foo.cc:13:3: error: 'a0num' does not name a type; did you mean 'enum'?
   a0num,a1num,b0num,b1num:array[1..max1+4] of longint;
   ^~~~~
   enum
/in/foo.cc:14:8: error: found ':' in nested-name-specifier, expected '::'
   temp2:array[1..4] of longint;
        ^
/in/foo.cc:14:3: error: 'temp2' does not name a type
   temp2:array[1..4] of longint;
   ^~~~~
/in/foo.cc:15:7: error: found ':' in nested-name-specifier, expected '::'
   temp:array[1..4] of big;
       ^
/in/foo.cc:15:3: error: 'temp' does not name a type
   temp:array[1..4] of big;
   ^~~~
/in/foo.cc:16:4: error: found ':' in nested-name-specifier, expected '::'
   t:big;
    ^
/in/foo.cc:16:3: error: 't' does not name a type
   t:big;
   ^
/in/foo.cc:17:7: error: found ':' in nested-name-specifier, expected '::'
   flag:boolean;
       ^
/in/foo.cc:17:3: error: 'flag' does not name a type; did you mean 'float'?
   flag:boolean;
   ^~~~
   float
/in/foo.cc:18:1: error: 'function' does not name a type; did you mean 'union'?
 function comp(a,b:longint):longint;
 ^~~~~~~~
 union
/in/foo.cc:19:1: error: 'begin' does not name a type
 begin
 ^~~~~
/in/foo.cc:21:3: error: expected unqualified-id before 'if'
   if a=b then exit(0);
   ^~
/in/foo.cc:22:7: error: expected constructor, destructor, or type conversion before '(' token
   exit(-1);
       ^
/in/foo.cc:23:1: error: 'end' does not name a type; did you mean 'enum'?
 end;
 ^~~
 enum
/in/foo.cc:24:1: error: 'procedure' does not name a type
 procedure getnum(a:longint;var num:array of longint;var bignum:longint);
 ^~~~~~~~~
/in/foo.cc:24:28: error: 'var' does not name a type; did you mean 'char'?
 procedure getnum(a:longint;var num:array of longint;var bignum:longint);
                            ^~~
                            char
/in/foo.cc:24:53: error: 'var' does not name a type; did you mean 'char'?
 procedure getnum(a:longint;var num:array of longint;var bignum:longint);
                                                     ^~~
                                                     char
/in/foo.cc:25:1: error: 'var' does not name a type; did you mean 'char'?
 var i,j,sqt:longint;
 ^~~
 char
/in/foo.cc:26:1: error: 'begin' does not name a type
 begin
 ^~~~~
/in/foo.cc:32:7: error: 'a' does not name a type
       a:=a div prs[i];
       ^
/in/foo.cc:33:5: error: 'end' does not name a type; did you mean 'enum'?
     end;
     ^~~
     enum
/in/foo.cc:34:5: error: expected unqualified-id before 'if'
     if a=1 then break;
     ^~
/in/foo.cc:35:5: error: expected unqualified-id before 'if'
     if (a<max1) and (prhash[a]>0) then begin inc(num[prhash[a]]);break;end;
     ^~
/in/foo.cc:35:66: error: expected unqualified-id before 'break'
     if (a<max1) and (prhash[a]>0) then begin inc(num[prhash[a]]);break;end;
                                                                  ^~~~~
/in/foo.cc:35:72: error: 'end' does not name a type; did you mean 'enum'?
     if (a<max1) and (prhash[a]>0) then begin inc(num[prhash[a]]);break;end;
                                                                        ^~~
                                                                        enum
/in/foo.cc:36:3: error: 'end' does not name a type; did you mean 'enum'?
   end;
   ^~~
   enum
/in/foo.cc:37:3: error: expected unqualified-id before 'if'
   if a>prs[prnum] then bignum:=a
   ^~
/in/foo.cc:39:1: error: 'end' does not name a type; did you mean 'enum'?
 end;
 ^~~
 enum
/in/foo.cc:40:1: error: 'begin' does not name a type
 begin
 ^~~~~
/in/foo.cc:42:3: error: 'prhash' does not name a type
   prhash[1]:=0;
   ^~~~~~
/in/foo.cc:43:3: error: expected unqualified-id before 'for'
   for i:=2 to trunc(sqrt(max1)) do
   ^~~
/in/foo.cc:49:10: error: 'end' does not name a type; did you mean 'enum'?
          end;
          ^~~
          enum
/in/foo.cc:50:3: error: 'end' does not name a type; did you mean 'enum'?
   end;
   ^~~
   enum
/in/foo.cc:51:3: error: 'prnum' does not name a type; did you mean 'enum'?
   prnum:=0;
   ^~~~~
   enum
/in/foo.cc:52:3: error: expected unqualified-id before 'for'
   for i:=1 to max1 do
   ^~~
/in/foo.cc:56:12: error: 'prs' does not name a type
            prs[prnum]:=i;
            ^~~
/in/foo.cc:57:12: error: 'prhash' does not name a type
            prhash[i]:=prnum;
            ^~~~~~
/in/foo.cc:59:10: error: 'end' does not name a type; did you mean 'enum'?
          end;
          ^~~
          enum
/in/foo.cc:60:9: error: expected constructor, destructor, or type conversion before '(' token
   readln(n);
         ^
/in/foo.cc:61:3: error: expected unqualified-id before 'for'
   for i:=1 to n do
   ^~~
/in/foo.cc:64:13: error: expected constructor, destructor, or type conversion before '(' token
     fillchar(a1num,sizeof(a1num),0);
             ^
/in/foo.cc:65:13: error: expected constructor, destructor, or type conversion before '(' token
     fillchar(a0num,sizeof(a0num),0);
             ^
/in/foo.cc:66:13: error: expected constructor, destructor, or type conversion before '(' token
     fillchar(b1num,sizeof(b1num),0);
             ^
/in/foo.cc:67:13: error: expected constructor, destructor, or type conversion before '(' token
     fillchar(b0num,sizeof(b0num),0);
             ^
/in/foo.cc:68:11: error: expected constructor, destructor, or type conversion before '(' token
     getnum(a1,a1num,temp[1].num);
           ^
/in/foo.cc:69:5: error: 'temp' does not name a type
     temp[1].typ:=1;
     ^~~~
/in/foo.cc:70:11: error: expected constructor, destructor, or type conversion before '(' token
     getnum(a0,a0num,temp[2].num);
           ^
/in/foo.cc:71:5: error: 'temp' does not name a type
     temp[2].typ:=2;
     ^~~~
/in/foo.cc:72:11: error: expected constructor, destructor, or type conversion before '(' token
     getnum(b0,b0num,temp[3].num);
           ^
/in/foo.cc:73:5: error: 'temp' does not name a type
     temp[3].typ:=3;
     ^~~~
/in/foo.cc:74:11: error: expected constructor, destructor, or type conversion before '(' token
     getnum(b1,b1num,temp[4].num);
           ^
/in/foo.cc:75:5: error: 'temp' does not name a type
     temp[4].typ:=4;
     ^~~~
/in/foo.cc:76:5: error: expected unqualified-id before 'for'
     for j:=1 to 4 do
     ^~~
/in/foo.cc:81:14: error: 'temp' does not name a type
              temp[j]:=temp[k];
              ^~~~
/in/foo.cc:82:14: error: 'temp' does not name a type
              temp[k]:=t;
              ^~~~
/in/foo.cc:83:11: error: 'end' does not name a type; did you mean 'enum'?
           end;
           ^~~
           enum
/in/foo.cc:84:5: error: 'x' does not name a type
     x:=prnum+1;
     ^
/in/foo.cc:85:5: error: expected unqualifi

代码

uses math;
type
  big=record
        num,typ:longint;
      end;
const
  max1=(trunc(sqrt(2000000000))+1);
var
  prhash:array[1..max1] of longint;
  prs:array[1..max1] of longint;
  prnum,i,j,maxx,minx,k:longint;
  a0,a1,b0,b1,biga0,biga1,bigb0,bigb1,n,ans,x:longint;
  a0num,a1num,b0num,b1num:array[1..max1+4] of longint;
  temp2:array[1..4] of longint;
  temp:array[1..4] of big;
  t:big;
  flag:boolean;
function comp(a,b:longint):longint;
begin
  if a>b then exit(1);
  if a=b then exit(0);
  exit(-1);
end;
procedure getnum(a:longint;var num:array of longint;var bignum:longint);
var i,j,sqt:longint;
begin
  for i:=1 to prnum do
  begin
    while a mod prs[i]=0 do
    begin
      inc(num[i]);
      a:=a div prs[i];
    end;
    if a=1 then break;
    if (a<max1) and (prhash[a]>0) then begin inc(num[prhash[a]]);break;end;
  end;
  if a>prs[prnum] then bignum:=a
                  else bignum:=1;
end;
begin
  filldword(prhash,sizeof(prhash),1);
  prhash[1]:=0;
  for i:=2 to trunc(sqrt(max1)) do
  begin
    if prhash[i]>0
    then begin
           for j:=i to (max1 div i) do
             prhash[j*i]:=0;
         end;
  end;
  prnum:=0;
  for i:=1 to max1 do
    if prhash[i]>0
    then begin
           prnum:=prnum+1;
           prs[prnum]:=i;
           prhash[i]:=prnum;
           //write(i,' ');
         end;
  readln(n);
  for i:=1 to n do
  begin
    readln(a0,a1,b0,b1);
    fillchar(a1num,sizeof(a1num),0);
    fillchar(a0num,sizeof(a0num),0);
    fillchar(b1num,sizeof(b1num),0);
    fillchar(b0num,sizeof(b0num),0);
    getnum(a1,a1num,temp[1].num);
    temp[1].typ:=1;
    getnum(a0,a0num,temp[2].num);
    temp[2].typ:=2;
    getnum(b0,b0num,temp[3].num);
    temp[3].typ:=3;
    getnum(b1,b1num,temp[4].num);
    temp[4].typ:=4;
    for j:=1 to 4 do
      for k:=j+1 to 4 do
      if temp[j].num>temp[k].num
      then begin
             t:=temp[j];
             temp[j]:=temp[k];
             temp[k]:=t;
          end;
    x:=prnum+1;
    for j:=1 to 4 do
    begin
      if (j<>1) and (temp[j].num<>temp[j-1].num) then inc(x);
      case temp[j].typ of
        1:a1num[x]:=1;
        2:a0num[x]:=1;
        3:b0num[x]:=1;
        4:b1num[x]:=1;
      end;
      temp2[x-prnum]:=temp[j].num;
    end;
    flag:=false;
    ans:=1;

    for j:=1 to prnum+4 do
    begin
      if (j>prnum) and (temp2[j-prnum]=1) then continue;
      case comp(a0num[j],a1num[j]) of
        1:begin
            maxx:=a1num[j];
            minx:=a1num[j];
          end;
        0:begin
            maxx:=maxlongint;
            minx:=a1num[j];
          end;
        -1:begin
             //writeln(0);
             flag:=true;
             break;
           end;
      end;
      case comp(b0num[j],b1num[j]) of
        1:begin
            //writeln(0);
            flag:=true;
            break;
          end;
        0:maxx:=min(maxx,b0num[j]);
        -1:begin
             maxx:=min(maxx,b1num[j]);
             minx:=max(minx,b1num[j]);
           end;
      end;
      ans:=ans*(maxx-minx+1);
      //if ans<0 then break;
    end;

    if (ans<0) or flag then begin writeln(0);continue;end;
    writeln(ans);
  end;
end.

信息

递交者
类型
递交
题目
改编小学数学题(第一个AC奖励5元)
题目数据
下载
语言
C++
递交时间
2017-10-13 15:03:24
评测时间
2017-10-13 15:03:24
评测机
分数
0
总耗时
40ms
峰值内存
2.945 MiB