ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

Why do I get "restricted function" (code included)
Послано Pier Paolo Guillen Hernandez 31 янв 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)
Послано Locomotive 31 янв 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)
Послано Pier Paolo Guillen Hernandez 31 янв 2003 19:30
Hi!

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