Hi, I am getting TLE in http://www.spoj.pl/problems/ABCDEF/3 using Python. I have try a lot of possibilities but none of them has been successful.
Removed after AC.
Lesson: On my PC, the program using defaultdict ran faster than the one using normal dict. On SPOJ, it was the opposite.
defaultdict module has gave me the best results. My program runs the test case 100 1 2 3 ... 100 in about 0.25s in my computer, but it gives TLE in SPOJ.
Besides, if I use
for (a, c) in product(w, w):
instead of
for a in w:
for c in w:
I got Runtime Error (NZEC), and I do not know why.
Can someone help me?
created
last reply
- 3
replies
- 964
views
- 3
users
- 1
link