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

Discussion of Problem 1100. Final Standings

Darth Niculus(Ivan Nicolae) Why COMPILATION ERROR!!!!!!!!!!!!!!!!!!!!!!!!! [6] // Problem 1100. Final Standings 4 Aug 2004 20:01
     I have a Pascal program. My computer compiles it perfect. I tried in to compile it in Free Pascal and Borland Pascal. It works. Why do I get compilation error?
Macarie programatorul in actiune Re: Why COMPILATION ERROR!!!!!!!!!!!!!!!!!!!!!!!!! [1] // Problem 1100. Final Standings 4 Aug 2004 20:07
the judge compiles it with Delphi...
Maybe you used a reserved word as variable...
check a list of them in delphi on a previous post...
Dmitry 'Diman_YES' Kovalioff Jury uses Free Pascal. Post your code here (-) // Problem 1100. Final Standings 4 Aug 2004 21:23
Vladimir Yakovlev (USU) Just check your e-mail! (+) [3] // Problem 1100. Final Standings 4 Aug 2004 22:38
Select "Reply to this/my E-Mail address" when you submit your code and check e-mail later. In the case of Compilation Error you recieve the list of errors.
Darth Niculus(Ivan Nicolae) Re: Just check your e-mail! (+) [2] // Problem 1100. Final Standings 6 Aug 2004 20:37
    I tried to compile it in Delphi and it works. I tried to compile it in Free Pascal and it works. What is the problem? I used Quick Sort.
    Here is my sorce:
    I hope you will find the problem.
   type vec=array[1..150000] of longint;
var i,n,k:longint;
    a:vec;
    b:vec;

procedure poz(li,ls:longint);
var i,j,c,i1,j1,as:longint;
begin
     i1:=0;
     j1:=-1;
     i:=li;
     j:=ls;
     while i<j do
          begin
               if a[i]<a[j] then
                 begin
                      c:=a[j];
                      a[j]:=a[i];
                      a[i]:=c;
                      as:=b[j];
                      b[j]:=b[i];
                      b[i]:=as;
                      c:=i1;
                      i1:=-j1;
                      j1:=-c;
                  end;
               i:=i+i1;
               j:=j+j1;
           end;
     k:=i;
end;

procedure quick(li,ls:longint);
begin
     if li<ls then
       begin
            poz(li,ls);
            quick(li,k-1);
            quick(k+1,ls);
        end;
end;

begin
     readln(n);
     for i:=1 to n do readln(b[i],a[i]);
     quick(1,n);
     for i:=1 to n do writeln(b[i],' ',a[i]);
end.
Vladimir Yakovlev (USU) See in [1] // Problem 1100. Final Standings 7 Aug 2004 01:06
Do you get that message in e-mail?

test.pas(7,17) Fatal: Syntax error, identifier expected but as found

It means that as is a reserved word.
Shogal [Kaliningrad] Re: See in // Problem 1100. Final Standings 10 Sep 2004 00:36
'as' is really reserved word so you have to rename it

Edited by author 10.09.2004 00:37