10733 - The Colored Cubes

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

10733 - The Colored Cubes

Post by Eduard »

Hello.
I'm getting WA for this problem.Please somebody who got it AC tell me outputs for this Inputs.
INPUT

Code: Select all

3
4
5
6
7
8
9
10
50
100
500
750
999
0
Thanks.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
gawry
New poster
Posts: 19
Joined: Fri Aug 02, 2002 5:54 pm

Post by gawry »

My (accepted) program's output is:

Code: Select all

57
240
800
2226
5390
11712
23355
43450
651886250
41679670000
651049541750000
7415811246281250
41417415833541750
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post by Eduard »

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

Code: Select all

1
2
100
121
521
765
888
777
999
123
456
754
123
10
123
102
105
11
2
16
21
0
OUTPUT

Code: Select all

1
10
41679670000
130795534551
833335599237051
8351406190633950
20429992757318592
9168895864471035
41417415833541750
144313962627
374614113302976
7656303440392490
144313962627
43450
144313962627
46937498610
55853094675
76351
10
709376
3602676
Somebody please check,are this outputs right?
Thanks.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post by Eduard »

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.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
wiktor
New poster
Posts: 5
Joined: Wed Sep 22, 2004 6:13 pm

Post by wiktor »

BigNumbers are not necessry for this problem. The solution for n=1000 fits in long long.
midra
Experienced poster
Posts: 119
Joined: Fri Feb 13, 2004 7:20 am
Contact:

Post by midra »

please...
could someone help me to understand how to think this problem...
I have stayed hours and I can't get the correct idea
thx...
Eduard
Experienced poster
Posts: 183
Joined: Fri Sep 26, 2003 2:54 pm
Location: Armenia,Yerevan

Post by Eduard »

I use nCm in my program that why I ca't use long long int and use double but get WA.
someone who like to solve informatic problems.
http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:29650
midra
Experienced poster
Posts: 119
Joined: Fri Feb 13, 2004 7:20 am
Contact:

Post by midra »

please...
could someone give me some hint to solve this problem??
I would appreciate very much
thanks
wiktor
New poster
Posts: 5
Joined: Wed Sep 22, 2004 6:13 pm

Post by wiktor »

google -> Polya theorem :D
abishek
Experienced poster
Posts: 131
Joined: Mon Dec 15, 2003 5:41 am

Post by abishek »

better search term
google for "burnside's lemma"
midra
Experienced poster
Posts: 119
Joined: Fri Feb 13, 2004 7:20 am
Contact:

Post by midra »

thanks a lot for your answers
byee
shamim
A great helper
Posts: 498
Joined: Mon Dec 30, 2002 10:10 am
Location: Bozeman, Montana, USA

Post by shamim »

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. :-?
Dreamer#1
Learning poster
Posts: 77
Joined: Tue Oct 07, 2003 10:07 pm

Post by Dreamer#1 »

hi ppl,

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 :oops: (infact i've never done any mathematics apart from whats done at skool and ofcourse i ain't a CS student either) :o but there are more people in my category and in most cases there remains a second way for us to get through.. thanks God... :D

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.
abishek
Experienced poster
Posts: 131
Joined: Mon Dec 15, 2003 5:41 am

Post by abishek »

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!
backslash null
New poster
Posts: 8
Joined: Tue Nov 11, 2003 11:02 pm

Post by backslash null »

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^?)/? :D :evil:
good luck.

8)
Post Reply

Return to “Volume 107 (10700-10799)”