PARCARD1 - Partition function (EASY)

You need to output the number of distinct ways of representing n as a sum of natural numbers (with order irrelevant) for all integer n from 0 to 10000 inclusive.

First numbers of output must be:

1 1 2 3 5 7 11 15 22 30 42 56 77

Added by:Michael Kharitonov
Date:2013-06-24
Time limit:1s
Source limit:10000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2018-04-29 13:54:00
@mikhaelkh Good problem.
2017-02-11 17:17:54 [Rampage] Blue.Mary
With updated Pike compiler ver 8.0 my old code get AC.
2015-02-13 14:21:36 MaHmOuD.
Can someone explain what (with order irrelevant) does mean?
thanks in advance.

(Francky)=>
1 + 2 = 2 + 1 are both the same sum equal to 3 (with order irrelevant).
1 + 2 + 2 = 2 + 1 + 2 are both the same sum equal to 5 (with order irrelevant). But 1+4 is another sum.

Last edit: 2015-02-13 20:40:48
2014-06-28 02:38:28 sarelfeniel
Fun. Python is slow :(
2013-08-02 11:54:44 Miguel Oliveira
trunganh, i don't know what language you use, but the output is less than 1mb. even python outputs it in less than 1sec easily
2013-08-01 18:53:26 trunganh
Sorry for a dump question, I wonder that only displaying 10,000 numbers should take more than one second so how can others get accept within 1 second ? Sorry if I misunderstand something.

Last edit: 2013-08-01 19:30:48
2013-07-28 04:04:52 BISMITH BLAC
for 1 is it 0 or 1 ?
2013-07-27 11:57:47 utpal kumar jha
any one plzz explain the output format i m unable to understand
2013-07-27 11:04:04 Vikas Kushwaha
good one :)
2013-07-04 09:14:37 Pranay
nice :)

Last edit: 2013-06-27 12:16:02
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.