Well I redid my little experiment with my [color=#FF0000]48 python solutions[/color] and got this now:
Python 2.5 + psyco: [color=#FF0000]48 AC + 0 TLE[/color]
Python 2.6: [color=#FF0000]19 AC + 28 TLE[/color]
Python 2.6 + pysco: [color=#FF0000]28 AC + 20 TLE[/color]
This shows to me that in general python 2.6 has worse performance. Psyco helps a little bit, but the overall performance is still a problem. We are going to suffer (even more) to make python solutions ACceptable.
You can check the list of executions here: br.spoj.pl/status/diegocaminha/signedlist/1
- I wonder if the designers of python language care at all about performance
As I see it, it isn't much worse than before. There were and are several problems that are impossible to solve using python, some of them because of the very strict time limit (e.g. https://www.spoj.pl/problems/ETF/1) and some others because of the enormous input. But there still remain a lot of problemsets you can use with python.
In some cases one should just improve the algorithm: https://br.spoj.pl/ranks/FATORIAL/lang=PYTH
I have more than 200 python2.5 solutions AC and there should be only a few that I won't get AC, e.g. https://www.spoj.pl/problems/SUMITR/ and https://www.spoj.pl/problems/ODDDIV/, both of which needed a lot (!) of optimizations to get it AC within the time limit using python.
Sure. The numbers I gave are just for having some general idea of the impact in the version update. Some of the solutions can get AC by optimizing the algorithm (when I see an easy time constraint problem, I usually prefer a clean/easy/'fast enough' solution), but my personal impression is still many (extra) problems would not get acceptable. But it is just my (non-expert) point of view.
CLTZ:
Python 2.5.x .... 1.26 s (0.81 with psyco)
Python 2.6.2 .... 2.31 s (1.68 s with psyco)
It is as I said before: There are some problemsets where you can optimize your code so that there is only little loss of performance, there are others (like CLTZ), where you can't. But nevertheless: You can get your solution to CLTZ get AC, even with Python 2.6.2 and without psyco. It isn't as fast as before, but - "what shalls" (as we Germans like to say ... )
SBANK: spoj.pl/status/SBANK,zzz/
It was AC with 5.62s, now the same my code got TLE
If the time limit is 7 s and there are python solutions AC in < 5 s and your solution gives TLE: There IS something to improve!
I have in store my ACcepted C++ code
PS
Adding Sevens: spoj.pl/ranks/ANARC08B/lang=PYTH
All of this summer submissions (i.e. v.2.5). Today my py code gets only TLEs (I've never solved this prob before).
What can be improved in my TLE code?
import psyco
psyco.full()
def foo():
a = (\
'063',
'010',
'093',
'079',
'106',
'103',
'119',
'011',
'127',
'107')
b = {\
'063':'0',
'010':'1',
'093':'2',
'079':'3',
'106':'4',
'103':'5',
'119':'6',
'011':'7',
'127':'8',
'107':'9'}
import sys
w = sys.stdin.readlines()
for wi in w:
s = wi.strip()
if s == 'BYE':
return
p = s[:s.index('+')]
q = s[s.index('+') + 1:][:-1]
pp = ''
for i in range(0, len(p), 3):
pp += b[p[i:i + 3]]
qq = ''
for i in range(0, len(q), 3):
qq += b[q[i:i + 3]]
z = str(int(pp) + int(qq))
r = ''
for zi in z:
r += a[int(zi)]
print s + r
foo()
Forum jest po to aby odpowiadać na pytania? Niestety, "ale nie mam innego pomysłu" to nie pytanie , mimo to jeszcze raz "powiem":
Jest algoliga.pl1 a tam z lewego boku, taki mały, podobny do tego tu na spoju, niebieski napis [color=#4000BF][b]forum[/b][/color]. "Idąc" tam warto wcześniej odblokować w swojej przeglądarce wykonywanie skryptów.
PS
W zasadzie wystarczyłoby tylko zwrócić uwagę na pierwszy link w moim podpisie.