Author |
Message |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Really should get back into this myself...
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Mon Aug 15, 2011 4:33 pm |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
Done 1 & 2, but they were rather trivial in Excel  Currently in the process of teaching myself vb.net so having to learn the syntax as I go along for these. Edit: Have worked out what I think is a logical way to go about doing number 3, now I just need to work out how to code it!
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Mon Aug 15, 2011 6:44 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Done number 4 now also.
Actually fairly an easy on. No arrays required or anything.
There is prob a quicker way of doing it but I basically had 2 loops with the inner loop getting smaller each time.
|
Wed Aug 17, 2011 2:50 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Woop!
Just done number 11!
It seems it's fairly doable just by hand and would probably be quicker to do it by hand than it took me to code it! LOL!
(Although that's mainly due to my lack of familiarity with C++).
I'm sure there are built in functions to build 2d arrays and vectors but I had to build them by hand.
|
Wed Aug 17, 2011 8:31 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
OK, problem number 20 done!
I even had to write a recursive function to multiply a string by a number and it worked first time!
That's a fricking huuuuuuuuuuuuuuuuuuuuuuuge number!
BOOM! Problem 16 done also!
and now 30!
BOOM!
(I really should get some work done now)
I was struggling with 34 until I realised that 0! = 1 not 0.
ARGH! So frustrating!
|
Thu Aug 18, 2011 9:26 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
OK, so now I've done...
1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 19, 20, 22, 28, 30, 34 and 79.
Only 5 more to go until I get onto lvl 1!
Been a real learning curve so far! The only one I wasn't happy with was 34 as it was a brute force attack that took a few minutes to complete.
I've actually just thought of a way to make it quicker. Should be considerably quicker also.
Hmm... how to implement...
|
Thu Aug 18, 2011 11:30 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Did 15 in Excel once I worked out how it works  Could program it but I'm at work. Using the same method 18 and 67 will be done tonight  However, as they are weighted paths I need to program them rather than do it in Excel 
|
Fri Aug 19, 2011 8:33 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Don't you just hate it when you write a program only to find out that the environment you are running in has a cripplingly low amount of memory. Just written a solution for 58 but it won't even calculate the primes upto 10000. Will have to copy paste into C++ and change the syntax.  OK, that's a huge number. Need to find another way around this.
|
Fri Aug 19, 2011 10:09 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
WOOP!
I've reached level 1!
25 complete!
Read about Dijkstra's algorithm last night and worked out an implementation using the language I use at work.
Applied it to 18 and 67 and it solved 67 in about 0.7 seconds!
Very pleased! Beginning to get to grips with these algorithm thingies. Also thinking about how to apply them to other sorts of problems (especially shortest path stuff).
|
Fri Aug 19, 2011 3:48 pm |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
Gah, 15 is doing my nut in. I'm convinced there is of course a forumula for an NxN grid, but I'm buggered if I can work it out.
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Sat Aug 20, 2011 3:46 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Let me know if you would like a subtle push in the right direction. Took me a lot of scribbling to work it out. I went through several iterations of trying to work out formulas and stuff before realising what was needed. --- I am here: http://maps.google.com/maps?ll=53.836762,-1.546622
|
Sat Aug 20, 2011 4:04 pm |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
Ok, redone 1 and 2 in C++, rather chuffed as they both worked first time; not even a compiling error. Rather chuffed with this as I'm learning C++ as I go along. That's all come crashing down with 3 though; I'm aware that the number is way too big to use int or long int, and things like the mod operation apparently cannot be used on floats or doubles. Not sure of a way round this... Edit: disocovered long long int 
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Sun Aug 21, 2011 3:48 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Nice one! I only did 3 after talking to you but spent a while trying to improve on it after writing it  Even after I got the answer I did it a few more times to try and improve the speed. --- I am here: http://maps.google.com/maps?ll=53.851236,-1.530917
|
Sun Aug 21, 2011 4:33 pm |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
I'm just trying to work out if it's better to go for a brute force list of factors and to then try and factorise those to see if they're prime or build up a list of primes and check if any of them are a factor of the total.
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Sun Aug 21, 2011 4:37 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Blah blah ignore this 
|
Sun Aug 21, 2011 4:46 pm |
|
|