|
CONTEST IS OVER! WINNER: forti
I have a unused friend invite key, which you are able to win by being the first to answer the following question:
First we need some definitions:
A supply depot fort is a square center area surrounded by an arbitrary number of supply depot rings. A ring either completely surrounds the center area or another ring.
Example 1 (just treat submerged depots as if there were no depots at that location)
Let's say your fort must be made of exactly eight supply depots, then the only valid configuration is this one:
---
Example 2: If you use 32 depots, there are two valid configurations:
---
We define s to be the number of used supply depots and nC(s) to be the number of valid supply depot fort configurations made of s supply depots (e.g. nC(32) = 2).
Furthermore let's say you have exactly one million supply depots at your disposal and you can choose any amount x of those supply depots to build a fort.
We define f(n) to be the number of different x for which nC(x) = n.
Example: + Show Spoiler +'f(13) = 123' means: there are 123 different values for x, so that for each of those x there are exactly 13 distinct, valid supply depot fort configurations. f(13) is not necessarily 123, I just made that up, but to check if you're on the right way, here is a hint: + Show Spoiler +Calculate f(15). edit: f(15) = 832Multiply the result with 123456. Go here Enter this text:
GxD4AhayOeDnC8oY7wKGVhRJ3BTPYiTxfomXV4SLiWTpSHmxa3C7+/v3ONNbTbeRZ7ZEhG0xHMV6R5aU0CL1gA==
Use what you calculated as password and decrypt. Decrypted text should be 'correct'
Here comes the questions worth the beta key:
What is the sum of f(1)+ f(2) + ... + f(9) + f(10)?
Answer + Show Spoiler +209566 forti's (annotated) c++ solution #include <stdio.h> #include <string.h> #include <stdlib.h> //standard C libraries
int array[1000005]; //array that stores the number of solutions using 1-1000000 supply depots
int main() { memset(array,0,sizeof(array)); //setting everything to 0 initially
for(int i=1;i<=249999;i++) //the width of center blank square AKA, i am assuming an //i x i square. 249999 is the maximum width possible with //1000000 supply depots used (1000000-4)/4 { int sum=0; //the number of boxes used at the moment
//the following section of the code basically adds //"supply depot layers" to the center square 1 by 1 for(int j=i;;j+=2) { int k=j*4+4; sum+=k; if(sum>1000000) break; array[sum]++; } } int temp,c; c=0;
//the final part computes f(1) to f(10) from what was // found previously for(temp=1;temp<=10;temp++) { for(int i=1;i<=1000000;i++) { if(array[i]==temp)c++; } } printf("%d\n",c); system("PAUSE"); }
---
Some details:
- My bnet account is on Europe and I don't know if the person using the friend key will also have to use a european account. Maybe someone can clarify that for me.
- I not only want the correct answer, I also want a little explanation why your answer is correct (source code, or just a short text describing the way you arrived at the solution)
- You can either post your entry in this blog or send me a pm.
- You are not limited to one guess, but please be reasonable and don't just bomb me with all integers from 1-100000 or something
- I will check this thread and pms periodically and let you know when I checked a possible solution
- The problem is kinda difficult, but I'm rather mediocre at maths and I was able to solve it after (quite) some time so I'm confident someone will find the solution.
Good luck!
edit1: just some definition clarifications edit2: we have a winner. edited in the solution
|
Korea (South)11566 Posts
why'd you close your other blog? meaning what was the answer to the other question?
|
|
+ Show Spoiler + my answer is 209566 using:
#include <stdio.h> #include <string.h> #include <stdlib.h>
int array[1000005]; int main() { memset(array,0,sizeof(array)); for(int i=1;i<=249999;i++)//center square { int sum=0; for(int j=i;;j+=2) { int k=j*4+4; sum+=k; if(sum>1000000) break; array[sum]++; } } int temp,c; c=0; for(temp=1;temp<=10;temp++) { for(int i=1;i<=1000000;i++) { if(array[i]==temp)c++; } } printf("%d\n",c); system("PAUSE"); }
|
the contest is already over, forti is the new owner of the beta key.
For anyone still interested in solving the question:
The described problem is a obfuscated version of this, so if you open an account there you can check your solution there (or you could just peek into forti's spoiler)
Seems like i kinda underestimated the possibility to brute force, but when I worked on that problem, my main difficulties were understanding and abstracting the problem and coming up with an algorithm. forti was much faster on that part, and thus is a worthy winner imo. Have fun playing sc2.
Btw, the first problem i posted i didn't paraphrase at all (just screenshotted this), and didn't realize that because of that the solution was just one google search away, and that's why the first contest was cancelled.
Anyways, I'm out of beta keys, so I guess this can also be closed now
|
Damn it! I chose dinner over this and I paid the price.
|
I spent some time thinking about an elegant mathematical solution. Then I put that aside and wrote a bruteforce version very similar to forti's in Python... but it was still running when forti won damn Python's slowness!
forti, gg! nice first post!
|
heh, I was watching KT vs STX and only saw this after the second set - like tarpman, had something in python going.
But then again I don't really crave a beta key close to as much as others here, so it's fine.
|
i'm quite surprised there are still so many people around here wanting a beta key. I had this key sitting in my inbox for quite some time, but for some reason i thought there wasn't much demand anymore
|
On April 13 2010 20:07 yh8c4 wrote: i'm quite surprised there are still so many people around here wanting a beta key. I had this key sitting in my inbox for quite some time, but for some reason i thought there wasn't much demand anymore
You should probably donate it to one of those poor starcraft players who didn't get a key *cough madnessman cough*....
|
On April 13 2010 20:07 yh8c4 wrote: i'm quite surprised there are still so many people around here wanting a beta key. I had this key sitting in my inbox for quite some time, but for some reason i thought there wasn't much demand anymore
|
On April 13 2010 19:14 forti wrote:+ Show Spoiler + my answer is 209566 using:
#include <stdio.h> #include <string.h> #include <stdlib.h>
int array[1000005]; int main() { memset(array,0,sizeof(array)); for(int i=1;i<=249999;i++)//center square { int sum=0; for(int j=i;;j+=2) { int k=j*4+4; sum+=k; if(sum>1000000) break; array[sum]++; } } int temp,c; c=0; for(temp=1;temp<=10;temp++) { for(int i=1;i<=1000000;i++) { if(array[i]==temp)c++; } } printf("%d\n",c); system("PAUSE"); }
*sigh* I just didn't understand any of that
|
|
congrats
|
On April 13 2010 21:06 krndandaman wrote: i've entered around 10 competitions for a sc2 beta key rofl
Ditto, maybe even more... Everyone's getting keys except me!! I even know people who won more than one some ever 3 but I still don't have one
|
|
One of my favorite contests so far ^^
|
|
wtf. This seems like a contest at school. I don't get to know about it until its already over/too late.
edit: I mean, this happened when I was asleep.... well I guess I've taken "you snooze you loose" to a new level lol.
|
On April 14 2010 00:11 krndandaman wrote:Show nested quote +On April 14 2010 00:07 GreEny K wrote:On April 13 2010 21:06 krndandaman wrote: i've entered around 10 competitions for a sc2 beta key rofl Ditto, maybe even more... Everyone's getting keys except me!! I even know people who won more than one some ever 3 but I still don't have one facebook's about to release a few more keys in 2hours on the starcraft fan page. it's a F5 refreshing fest. join the club. Were all Beta key contest failures
|
|
|
|