DEV Community

Discussion on: Manipulating Lists in Python 3 for Competitive Programming

Collapse
 
abdelrahmandeghedy profile image
Abdelrahman AbouDeghedy

Hi João,

It was some ideas from my experience solving problems in preparation for the ACM

About Numpy, we can't install an external library in the ACM, so I tried to figure out some alternative methods, So I used them in small programs written for competitive programming problems

I used lists with different types before

Thanks!

Collapse
 
joaomcteixeira profile image
João M.C. Teixeira

That is a very nice explanation. Maybe you can add that as an intro in the post, to contextualize your implementation.

Sorry, I am not from a computer science background, ACM stands for?

Cheers,

Thread Thread
 
abdelrahmandeghedy profile image
Abdelrahman AbouDeghedy

Great idea!

The full name is: ACM ICPC
It stands for: Association for Computing Machinery - International Collegiate Programming Contest

You can read more at:
en.wikipedia.org/wiki/Internationa...

I only participated in the local one, I didn't qualify to the international

Thanks!

Thread Thread
 
joaomcteixeira profile image
João M.C. Teixeira

Thanks so much for explaining me.

I found your implementation very curious. At fist, it looks like: "why would I want to do this?", but then...

I work a lot with Numpy, but somehow within I feel there will be a place for an implementation like this in my projects.

How large are the lists you have worked with? Do you have any experience in performance? More than 2 dimensions? :-) as you can see, I am a very curious person.

I am having quite busy days, but asap I have some spare time I will have a close look also.

Cheers,

Thread Thread
 
abdelrahmandeghedy profile image
Abdelrahman AbouDeghedy

Unfortunately, I don't quite remember, but most of the problems I solve have the following properties:

1) Running time = 2 seconds
2) Size of the list = 10e5 or 10e6

Those numbers are approximations, not exact!

I usually use lists with no more than two dimensions

Hope that helps!

Thread Thread
 
joaomcteixeira profile image
João M.C. Teixeira

That helps a lot.

I will let you know if I explore this concept further. I certainly will.
Cheers,

Thread Thread
 
abdelrahmandeghedy profile image
Abdelrahman AbouDeghedy

Glad to hear that

Good luck!