pascal compiler (used by online judges)?

Write here if you have problems with your Pascal source code

Moderator: Board moderators

Post Reply
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

pascal compiler (used by online judges)?

Post by kwedeer »

I am new to this - so can someone give accurate information what kind of Pascal compiler (and exact release/build) is used by online judges and whether can it be downloaded for personal use (for WinXP)...

I have completed some progams that run on FreePascal normally - but - I get compile error when I submit them... I have heard about 2: gpc and freepascal, one of them is not longer used... where to find this information?

Thanks in advance!
:)))
marcadian
New poster
Posts: 45
Joined: Sun Jun 26, 2005 6:21 am
Contact:

Post by marcadian »

UVA is used free pascal compiler, maybe you used something that doesn't allow to be use in UVA like uses
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

http://online-judge.uva.es/board/viewtopic.php?t=7428

Remove platform-specific lines (uses crt, DOS; clrscr;) from your code. If this doesn't help, post some code that fails to compile at UVa.
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post by kwedeer »

Many thanks, misof, about link, You wrote:
Please note that your program will be compiled with "-dONLINE_JUDGE -Sd" which defines the ONLINE_JUDGE according to the documentation
Can You give some link to this documentation page?

Thnaks in advance :)))
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post by kwedeer »

OK, here is screen from my computer:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>cd C:\FPC\2.0.0\bin\i386-win32

C:\FPC\2.0.0\bin\i386-win32>comp

C:\FPC\2.0.0\bin\i386-win32>fpc -dONLINE_JUDGE -Sd PrgXXXX.pp
Free Pascal Compiler version 2.0.0 [2005/05/08] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Win32 for i386
Compiling PrgXXXX.pp
Linking PrgXXXX.exe
105 Lines compiled, 0.2 sec

C:\FPC\2.0.0\bin\i386-win32>

and here - online judge status report:
'Compile Error'

any comments?
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

FreePascal documentation (more than you will ever need ;)
http://www.freepascal.org/docs.html

Try posting the source code of one of your programs that got Compilation error.
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post by kwedeer »

thanks - actually I hoped to find some docs does ONLINE_JUDGE means something more than some definition for use in ifdef etc. I feel - that not.

OK - fpc (with previous options) allow 'somevar: array of String;' well but - online judge allow only static arrays of string - it is my observation. Now I am coping with wrong answers...
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post by kwedeer »

besides - it is said that resources is not actual -http://acm.uva.es/problemset/pascalgpc.html - however - it would be nice to know whether advices about reading input, end of line character etc are useful for the current online judge and try to make relevant corrections?

btw - what is common practice - maybe I shoul try to use C++ - and experience less problems?
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

kwedeer wrote:besides - it is said that resources is not actual -http://acm.uva.es/problemset/pascalgpc.html - however - it would be nice to know whether advices about reading input, end of line character etc are useful for the current online judge and try to make relevant corrections?

btw - what is common practice - maybe I shoul try to use C++ - and experience less problems?
Most of the submissions are in C++, look here: http://acm.uva.es/problemset/statsjudge.php for some statistics

In ACM contests, C/C++ is the universal language that's supported everywhere. Some regions allow the use of Java and some allow Pascal, but Pascal won't be used at the World Finals anymore.
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post by kwedeer »

I found an interesting issue in some post:
Thu Jun 20, 2002 7:33 pm Post subject:

--------------------------------------------------------------------------------

...One thing that could be wrong is the way you treat line-breaks (combination of read(ch) and write(ch)). As you probably know, the judge translates our Pascal-code to C-code first, and then compiles it. C has a 'funny' way to handle line-breaks, especialy on a unix machine, so things could go wrong here.
I have not verified this, but I have a 'gut-feeling' about it. Try
Is is true at the present moment as well? And if it does - so - what type of converter is used - as I can guess - it can be some open source software also?
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

kwedeer wrote:I found an interesting issue in some post:
Thu Jun 20, 2002 7:33 pm Post subject:

--------------------------------------------------------------------------------

...One thing that could be wrong is the way you treat line-breaks (combination of read(ch) and write(ch)). As you probably know, the judge translates our Pascal-code to C-code first, and then compiles it. C has a 'funny' way to handle line-breaks, especialy on a unix machine, so things could go wrong here.
I have not verified this, but I have a 'gut-feeling' about it. Try
Is is true at the present moment as well? And if it does - so - what type of converter is used - as I can guess - it can be some open source software also?
This doesn't apply anymore, FreePascal is a standalone compiler. The issue you mention is years old and applied to gpc.
snail.123
New poster
Posts: 14
Joined: Wed Jun 13, 2007 3:29 am
Location: Taiwan

Pascal Compiler and Parameters used by the judge

Post by snail.123 »

One of my friends is building a online judge himself. I asked if he could add Pascal to his accepted languages. He then ask me what compiler and version to use and what parameters settings should be added? I would prefer his judge to be as close to your judge as possible. So, if it is possible, can you provide me these details base on the experience you had with this judge? Thanks a lot!

If you prefer, you can email me at snail.123@gmail.com.
Post Reply

Return to “Pascal”