My program is giving the same answers as yours but i'm getting WA.I hade precalculate the whole values and store in one array but it didn't help.WA,WA,WA....What it could be???
For example some I/O. INPUT
Finally I got it AC.I just change my cauculation to BigNumber cauculation and get AC.I will try to find for what cases my last program is giving wrong answer.I want to know does anybody else use BigNumber for this problem?
Thanks.
Hey, this problem seems to have a closed form solution. That is, a formula relating the input and output. The actual code would then be effectively two lines, take input and give output using formula.
The problem is a well known one in group theory. but I wonder, did the problemsetter wanted us to use the formula, or he expected us to derive it or an equivalent one using basic combinatorics.
hmm... well i don't think you need to know all those mathematical things to solve it... it took me 20 mins to write a simple simulator that gave me the results from n=1 to 6 and from there it took me another 10 mins to code my solution using those values and simple nCm calculations that everyone knows more or less... the runtime of my solution is O(1) too but the initial pascal's triangle generation took some time (ofcourse you can avoid that) and so it ran for around 0.050 sec...
i never heard of all these mathematical things you have been discussing here cause i'm too poor in mathematics (infact i've never done any mathematics apart from whats done at skool and ofcourse i ain't a CS student either) but there are more people in my category and in most cases there remains a second way for us to get through.. thanks God...
regards...
Dreamer
Not all of our dreams can be made to come true. But still we live with the hope to turn them into reality someday.
the answer is actually a polynomial in n. so you were lucky to get it right by fitting it with the first
six values.
actually, for any of these one doesnot need burnsides lemma because anyways the answers is polynomial in n and thus you can try to fit it.
but try 10601, cubes. Slightly more difficult to fit!
this problem is easier than it seems.
you don't have to any `lemma' to solve this problem.just think of a simple combinatorial formula.
after u find that try to solve it manualy and you get a polynomial of n lie this:
(n^6 + ?*n^4 + ... +8*n^?)/?
good luck.