Hi

I've looked at the example that smfiles (aka 1668151593 at tencent)
provided. It looks to me like smfiles is asking for help with a homework
problem. If smfiles tells me I'm wrong, I'll apologise.

By the way, because the number of parts is fixed, and because the order
matters, the OP's problem does not involve integer partitions.

Off topic. By chance last week I was looking for Python code to generate
integer partitions. I found the following particularly helpful.

https://stackoverflow.com/questions/10035752/elegant-python-code-for-integer-partitioning
http://jeromekelleher.net/generating-integer-partitions.html
https://arxiv.org/abs/0909.2331 # Generating All Partitions: A Comparison
Of Two Encodings

The last item shows "the ascending composition generation algorithm is
substantially more efficient than its descending composition counterpart".
It so happens that for my problem it's ascending generation that I want.

with best regards

Jonathan
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QC3VGUCGMVG6KR2ULE52I7Q23MXKRBIV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to