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

Why do I get "restricted function" (code included)
Posted by Pier Paolo Guillen Hernandez 31 Jan 2003 00:35
Hereґs my code:

Type
    parbol= ^arbol;
    arbol= record
         dato: word;
         izq,der: parbol;
         end;

Var
   a,act,ant,temp: parbol;
   i,n: integer;
   d: array [1..3000] of word;

Procedure imprime(z: parbol);
          begin
          if z^.der <> NIL then imprime(z^.der);
          if z^.izq <> NIL then imprime(z^.izq);
          write(z^.dato,' ');
          end;

Begin
     New(a);
     readln(input,n);
     for i:= 1 to n do
         read(input,d[i]);
     a^.dato:= d[n];
     a^.izq:= NIL;
     a^.der:= NIL;
     for i:= n-1 downto 1 do
         begin
         act:= a;
         Repeat
               ant:= act;
               if act^.dato > d[i] then act:= act^.izq
                                   else act:= act^.der;
               until (act = NIL);
         New(temp);
         temp^.dato:= d[i];
         temp^.der:= NIL;
         temp^.izq:= NIL;
         if ant^.dato > d[i] then ant^.izq:= temp
                             else ant^.der:= temp;
         end;
     imprime(a);
     Dispose(a);
End.
Re: Why do I get "restricted function" (code included)
Posted by Locomotive 31 Jan 2003 08:24
Hi Dear
i dont found any error on your program but because Ueal`s pascal
compiler is delphi (as i know), i might it works with linked list, so
bad.
So i recommend you to write this solution with Array (not linked^
list!)...
And Also please tell me what is number of the problem, you are
writing for?
And also,
Because of Judge machine errors (as you see too many waiting at
online status), it might that judge machine mistakes not you!
some days ago i submit a problem and got WA, and the next day morning
when i submit that solution (without any change), i got AC!

They was all i could do for you...
Sincerely
Aidin_n7
Re: Why do I get "restricted function" (code included)
Posted by Pier Paolo Guillen Hernandez 31 Jan 2003 19:30
Hi!

  Thanks a lor for your help. The problem I'm solving is: 1136
Parliament.