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 1338. Automobiles

><
Posted by o_O 19 Jan 2006 00:18

3 3
ooo
ooo
ooo
1
5

Please ask me Answer. :)
Answer
Posted by c0der 9 Feb 2006 12:55
Experiment #1: North: 1, South: 1, East: 3, West: 3
Re: Answer
Posted by ACM.Tolstobrov_Anatoliy[Ivanovo SPU] 11 Feb 2006 01:14

Thank you.
But i got AC faster when you answer me. :)

This problem real NP.
Only solo BFS.
I whant ask somethink.
Posted by ACM.Tolstobrov_Anatoliy[Ivanovo SPU] 11 Feb 2006 01:23

Somebody can me explane why all fast programs(1338) written on C?
C(C++) faster working when pasCAL?
Re: I whant ask somethink.
Posted by GaLL 13 Feb 2006 09:58
Of course C++ must run faster than Pascal. I don't know what kind of cpp compiler is being used on Timus (this is a great mystery, Yakovlev won't tell about it even for $1000000 :o(  ), but it seems be well. I don't say that Pascal syntax is too bad, that good compiler cannot be developed principially. It's a fate of this language - Borland makes it priority, and it's well-known that this company is too lazy for making good compilers. Disassembling Delphi code I saw terrible things:
mov eax,eax    -  what for?

xor eax,eax  - looks good, but "xchg" cannot be put in cash
xchg eax,[..]  therefore very-very slow

nop after each procedure - it has no sense, because it doesn't align for 16 bytes. Normal compiler must align the beginning of every procedure for 16 bytes by nops or something else.

Timus uses FreePascal - it's a the best choice for Pascal.

P.S. Sorry for boring 'lection' but it's too sad that many people think that C++ and Pascal are equal - it's quite incorrect! The efficiency of MVC and other (but not C++ Builder - it is only cpp-Delphi) brought many programmers for good choice.
That GaLL is really annoying :) (+)
Posted by Dmitry 'Diman_YES' Kovalioff 13 Feb 2006 13:45
Look, on Timus Top Coders: First Challenge there was an optimization problem - 1422 "Fireflies". While creating this problem Ilya Grebnov wrote rather short solution, which runs within 1.1 sec. This solution (as well as all our solutions) was written on Pascal.

I should say again and again, C++ IS NOT faster than Pascal, they are almost equal. There is no problem on Timus Online Judge which cannot be solved on Pascal or C++.

P.S. Dear GaLL, I suppose you like C++ very much, but could you like it silently, ok? :)

P.P.S. The discussion is closed. I do not want to see any disputes like Pascal vs. C++.

Edited by author 13.02.2006 13:47
Re: That GaLL is really annoying :) (+)
Posted by GaLL 13 Feb 2006 14:11
"C++ IS NOT faster than Pascal..."
Do you understand what you say??? EVERY algo (except primitive search or smthg else) written on Delphi, that U like very  much, works slower that the same written on Visual Studio.
I guess you never prooved that, so don't say things that you don't know.
P.S. Probably, Ilya Grebnov wrote a good hash, or invented fast O(N^2) (O(N^2*logN)) algorithm.
Who's annoying? (+)
Posted by Michael Rybak (accepted@ukr.net) 13 Feb 2006 14:55
Usually, when I like something not only because I'm used to liking it, but also because I know why it's worth liking, I'm not against any non-offensive discussions on the topic.

Please note that everything that GaLL wrote is not as much offensive at all as "That GaLL is really annoying" is, no? Even with the trailing smilie. Why do you panic so much about Pascal vs C++ discussions, what's wrong unless someone says any of two sucks without justifying his point?

I never came to compare explicitly, but indeed, when I happened to write same algo in both languages, the run time never really differed, but what's so bad about speaking on the topic? Everyone has the right to speak out his mind.
Re: That GaLL is really annoying :) (+)
Posted by Alias (Alexander Prudaev) 6 Apr 2007 22:55
it's funny message
(recieved by Dmitry 'Diman_YES' Kovalioff 13 febr 2006 13:45 )
I think you change your mind, because 1395 (Pascal Vs C++ Version 2) you solve using C++
try to write pascal program which would be faster then mine C++ program