ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Compilation Error ! Please help me . I can compile it in my BP 7.0 Compiler , but not here .
Posted by Nguyen Viet Bang 15 Jun 2002 14:41
  By the way , could you please send me the reserved words of Delphi ?
( The exception words from Pascal Reserved words )?
  Thanks a lot .
Sorry , I forgot to post my source . It's here
Posted by Nguyen Viet Bang 15 Jun 2002 14:43
>   By the way , could you please send me the reserved words of
Delphi ?
> ( The exception words from Pascal Reserved words )?
>   Thanks a lot .

My source here :

{ nikifor _ 2
obtain y from x by erasing some x digits }

CONST
     INP                =               '1071.inp';
     OUT                =               '1071.out';
     maxco              =               1000000 ;
     maxl               =               200 ;

TYPE
  ar1           =       array[1..maxl] of longint ;

VAR
  b_radix,lenx,leny,x,y           :       longint ;
  ax,ay                   :       ar1 ;
  b_ok                      :       boolean ;

PROCEDURE       InputRead ;
  begin
{    assign (input,inp);
    reset(input);}
    readln (x,y) ;
{   close(input);}
  end;

PROCEDURE       d_convert ( x : longint ; var a : ar1 ; var lena :
longint) ;
  begin
    lena:=0 ;
    while x > 0 do
      begin
        inc (lena) ;
        a[lena]:=x mod b_radix ;
        x:=x div b_radix ;
      end ;
  end ;

PROCEDURE       d_check ;
  var
    i,j,left            :       integer ;
    stop                :       boolean ;
  begin
    left:=1 ;
    for i:=1 to leny do
      begin
        stop:=true ;
        for j:=left to lenx do
          if ax[j] = ay[i] then
            begin
              left:=j+1 ;
              stop:=false ;
              break ;
            end ;
        if stop then exit ;
      end ;
    b_ok:=true ;
  end ;

PROCEDURE       Process ;
  var
    i           :       longint ;
  begin
    b_ok:=false;
    for i:=2 to maxco do
      begin
        b_radix:=i ;
        if i = 100000 then
          i:=i ;
        d_convert ( x,ax,lenx) ;
        d_convert ( y,ay,leny) ;
        d_check ;
        if b_ok then exit ;
      end ;
  end;

PROCEDURE       OutputWrite ;
  begin
{    assign( output,out);
    rewrite (output);}
    if b_ok then writeln(b_radix)
    else writeln('No solution') ;
{    close (output);}
  end;

BEGIN
  InputRead ;
  Process ;
  OutputWrite ;
END.
Re: Sorry , I forgot to post my source . It's here
Posted by Meo Meo 15 Jun 2002 14:54
A little mistake, give up it you'll get AC, I've tried.

>
> { nikifor _ 2
> obtain y from x by erasing some x digits }
>
> CONST
>      INP                =               '1071.inp';
>      OUT                =               '1071.out';
>      maxco              =               1000000 ;
>      maxl               =               200 ;
>
> TYPE
>   ar1           =       array[1..maxl] of longint ;
>
> VAR
>   b_radix,lenx,leny,x,y           :       longint ;
>   ax,ay                   :       ar1 ;
>   b_ok                      :       boolean ;
>
> PROCEDURE       InputRead ;
>   begin
> {    assign (input,inp);
>     reset(input);}
>     readln (x,y) ;
> {   close(input);}
>   end;
>
> PROCEDURE       d_convert ( x : longint ; var a : ar1 ; var lena :
> longint) ;
>   begin
>     lena:=0 ;
>     while x > 0 do
>       begin
>         inc (lena) ;
>         a[lena]:=x mod b_radix ;
>         x:=x div b_radix ;
>       end ;
>   end ;
>
> PROCEDURE       d_check ;
>   var
>     i,j,left            :       integer ;
>     stop                :       boolean ;
>   begin
>     left:=1 ;
>     for i:=1 to leny do
>       begin
>         stop:=true ;
>         for j:=left to lenx do
>           if ax[j] = ay[i] then
>             begin
>               left:=j+1 ;
>               stop:=false ;
>               break ;
>             end ;
>         if stop then exit ;
>       end ;
>     b_ok:=true ;
>   end ;
>
> PROCEDURE       Process ;
>   var
>     i           :       longint ;
>   begin
>     b_ok:=false;
>     for i:=2 to maxco do
>       begin
>         b_radix:=i ;

------>
>         if i = 100000 then
>           i:=i ;
-----> why do you need this command ? It make you get CE
because you can't use command here that change i inside the command
for i := .. but you can when using BP.



>         d_convert ( x,ax,lenx) ;
>         d_convert ( y,ay,leny) ;
>         d_check ;
>         if b_ok then exit ;
>       end ;
>   end;
>
> PROCEDURE       OutputWrite ;
>   begin
> {    assign( output,out);
>     rewrite (output);}
>     if b_ok then writeln(b_radix)
>     else writeln('No solution') ;
> {    close (output);}
>   end;
>
> BEGIN
>   InputRead ;
>   Process ;
>   OutputWrite ;
> END.
Re: Sorry , I forgot to post my source . It's here
Posted by Dinh Hong Minh 16 Jun 2002 23:25
 You should change two procedures 's name InputRead, OutputWrite to
ReadInput and WriteOutput. Maybe you'll get Accepted :)

> A little mistake, give up it you'll get AC, I've tried.
>
> >
> > { nikifor _ 2
> > obtain y from x by erasing some x digits }
> >
> > CONST
> >      INP                =               '1071.inp';
> >      OUT                =               '1071.out';
> >      maxco              =               1000000 ;
> >      maxl               =               200 ;
> >
> > TYPE
> >   ar1           =       array[1..maxl] of longint ;
> >
> > VAR
> >   b_radix,lenx,leny,x,y           :       longint ;
> >   ax,ay                   :       ar1 ;
> >   b_ok                      :       boolean ;
> >
> > PROCEDURE       InputRead ;
> >   begin
> > {    assign (input,inp);
> >     reset(input);}
> >     readln (x,y) ;
> > {   close(input);}
> >   end;
> >
> > PROCEDURE       d_convert ( x : longint ; var a : ar1 ; var
lena :
> > longint) ;
> >   begin
> >     lena:=0 ;
> >     while x > 0 do
> >       begin
> >         inc (lena) ;
> >         a[lena]:=x mod b_radix ;
> >         x:=x div b_radix ;
> >       end ;
> >   end ;
> >
> > PROCEDURE       d_check ;
> >   var
> >     i,j,left            :       integer ;
> >     stop                :       boolean ;
> >   begin
> >     left:=1 ;
> >     for i:=1 to leny do
> >       begin
> >         stop:=true ;
> >         for j:=left to lenx do
> >           if ax[j] = ay[i] then
> >             begin
> >               left:=j+1 ;
> >               stop:=false ;
> >               break ;
> >             end ;
> >         if stop then exit ;
> >       end ;
> >     b_ok:=true ;
> >   end ;
> >
> > PROCEDURE       Process ;
> >   var
> >     i           :       longint ;
> >   begin
> >     b_ok:=false;
> >     for i:=2 to maxco do
> >       begin
> >         b_radix:=i ;
>
> ------>
> >         if i = 100000 then
> >           i:=i ;
> -----> why do you need this command ? It make you get CE
> because you can't use command here that change i inside the command
> for i := .. but you can when using BP.
>
>
>
> >         d_convert ( x,ax,lenx) ;
> >         d_convert ( y,ay,leny) ;
> >         d_check ;
> >         if b_ok then exit ;
> >       end ;
> >   end;
> >
> > PROCEDURE       OutputWrite ;
> >   begin
> > {    assign( output,out);
> >     rewrite (output);}
> >     if b_ok then writeln(b_radix)
> >     else writeln('No solution') ;
> > {    close (output);}
> >   end;
> >
> > BEGIN
> >   InputRead ;
> >   Process ;
> >   OutputWrite ;
&
Thanks everybody . Good friends !
Posted by Nguyen Viet Bang 17 Jun 2002 16:50