same env as judge...

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
mirek.rusin
New poster
Posts: 1
Joined: Sat Apr 24, 2004 4:25 pm

same env as judge...

Post by mirek.rusin »

..does anybody know if there is somewhere on the net compiler-pack, same as judge.
i mean - without restricted functions, same stl implementation, etc?
anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

As far as I know, they wrote and changed some functions of bash and c compiler so that it works in that manner. I don't know whether it is true or not. Hope others will help you.
"Everything should be made simple, but not always simpler"
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

The OJ works on gcc 2.95. The comment made by anupam has nothing to do.
anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

Oh! Thank you for your correction. Right you are. I answered wrong. I thought he wanted to know how special features of the compiler of judge (restricted function, no file access) works.
The later post is correct. It works on gcc .
Thank you.
"Everything should be made simple, but not always simpler"
alexkro
New poster
Posts: 9
Joined: Sun Jan 12, 2003 12:18 pm

Post by alexkro »

Krzysztof Duleba wrote:The OJ works on gcc 2.95.
Pardon for my harshness, but gcc 2.95 - it's just a shame! Valladolid is boasting of using the advanced OS and software (http://acm.uva.es/problemset/computer.html), and at the same time - gcc2.95 which is an ancient, ancient compiler. It just sucks, did you know that gcc3.4 existed? Install at least gcc3.2, is it so freaking difficult?
CDiMa
Experienced poster
Posts: 214
Joined: Fri Oct 17, 2003 5:49 pm
Location: Genova

Post by CDiMa »

alexkro wrote:
Krzysztof Duleba wrote:The OJ works on gcc 2.95.
Pardon for my harshness, but gcc 2.95 - it's just a shame! Valladolid is boasting of using the advanced OS and software (http://acm.uva.es/problemset/computer.html), and at the same time - gcc2.95 which is an ancient, ancient compiler. It just sucks, did you know that gcc3.4 existed? Install at least gcc3.2, is it so freaking difficult?
Please don't be rude!
There are many implications in changing the compiler in the online-judge which you may not be aware of, it surely isn't simply a matter of installing a compiler.
For a start you may consider the fact that newer versions of the compiler may increase significantly the load on the judge. Probably that's not what you want.

Ciao!!!

Claudio
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

Valladolid is boasting of using the advanced OS and software (http://acm.uva.es/problemset/computer.html)
Well, maybe that page wasn't simply updated for a long time. You know, few years ago gcc 2.95 was really, really advanced.
For a start you may consider the fact that newer versions of the compiler may increase significantly the load on the judge. Probably that's not what you want.
That's true. Due to low server performance OJ doesn't even use optimalization options as they increase compilation time significantly.

Another thing is that code compiled with different compilers may produce different output. Rejudging all the past submissions doesn't sound good.
GreenPenInc
Learning poster
Posts: 53
Joined: Sat May 01, 2004 9:31 pm
Contact:

Post by GreenPenInc »

I think the harshness is justified, to some degree. A better compiler would be much appreciated. I'm sick of getting everything working on my own computer just fine, only to have a TLE or RTE on the OJ where there's no reason for one. At least with a compile error it tells me what went wrong! There's just no reason I should have 20+ erroneous submissions for #209 when my logic is correct. (And I still don't have AC!)
_-(GPI)-_

"Finally I have freed myself from the clutches of the garbage fairy!"
Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

There's just no reason I should have 20+ erroneous submissions for #209 when my logic is correct.
I think you won't find a compiler that will tell you that passing a char pointer that points to nowhere to getline is no good idea :wink:
And the old compiler has also some advantage: you don't have to write
using namespace std;
whereas gcc 3.2 requires this line whenever you use some STL library.
CDiMa
Experienced poster
Posts: 214
Joined: Fri Oct 17, 2003 5:49 pm
Location: Genova

Post by CDiMa »

GreenPenInc wrote:I think the harshness is justified, to some degree. A better compiler would be much appreciated. I'm sick of getting everything working on my own computer just fine, only to have a TLE or RTE on the OJ where there's no reason for one.
I'd say when you don't know the reason...

Ciao!!!

Claudio
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

Adrian, you're wrong.

g++ 2.95 allows you to skip writing the exact namespace of a function only if you use old-style headers like <iostream.h> (which are present in g++ 3.2 and 3.3 too). If you use <iostream>, you must add namespace name the same way as in newer versions of the compiler.
Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

So why does the following program compile without compile error?

#include <iostream>
#include <vector>

int main() {
vector<int> test;
cout << "Hello world" << endl;
return 0;
}
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

I tried the code you wrote and it compiled. I'm amazed. Thanks for info.
Post Reply

Return to “C++”