Search found 16 matches
- Tue Aug 10, 2010 11:45 pm
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
@Zeta: Yeah I think I'm inherently really lazy lol.. I was hoping not having to pack multiple bools in an int. It becomes a hassle when I want to find the right pivot and checking for stuff like that, and on top of that there is ensuring the padding is done correctly when your data is not of length ...
- Tue Aug 10, 2010 3:32 am
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
Holy fuck I just cut down my running time for lvl150 from >100s to 17s and my memory usage from megabytes to kilobytes just by setting the right compiler flags and changing my chars to longs (32 bits)!! I guess with those flags on, it effectively does the multiple bit operations that I wanted. There...
- Tue Aug 10, 2010 12:33 am
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
@CodeX: Oh I didn't know about the joint firstness lol. Yeah one day I'll recode that thing and I'll get to 513 easy peasy :) In fact, I didn't even code this version myself. It was exam time and my friends wanted me to give them practice questions. So I broke the problem down into individual functi...
- Mon Aug 09, 2010 1:42 am
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
I haven't finished Runaway because I'm lazy :P I coded it up after my first introductory course in computer science at Waterloo (I never programmed before, unless you count html lol). We used Scheme as an intro language. Clearly I did not understand memory management and call stacks after 4 months.....
- Mon Aug 09, 2010 1:34 am
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
- Sun Aug 08, 2010 9:55 pm
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
- Sun Aug 08, 2010 6:22 pm
- Forum: Crossflip
- Topic: Code optimization
- Replies: 57
- Views: 156370
Code optimization
I coded my solution to crossflip in C++ but I didn't get the speed I expected... I know my algorithm is asymptotically near optimal (I didn't try to understand how to solve a matrix in under O(n^3) time over the Z_2 field), but I don't know much about low-level optimization techniques. Anybody care ...
- Sun Jul 19, 2009 7:17 pm
- Forum: Challenges Solved
- Topic: Broken Keys
- Replies: 15
- Views: 1488
Broken Keys
I "solved" this by using the fact that max(a,b) = (|a-b|+a+b)/2, and Newton's method to calculate the square root of (a-b)^2. However, it shouldn't have passed when a-b = 0 because I'm dividing by 0 in newton's method. I got error messages but I still "passed"... Here's my code: ...
- Wed Jul 08, 2009 7:28 pm
- Forum: Challenges Solved
- Topic: Random Problem
- Replies: 11
- Views: 949
i think you've mistaken with another challenge public int bucketFromRandom(int randomNumber) { int a[] = new int[10]; for (int i = 0; i < a.length; i++) a = i * randomNumber; int index = Math.abs(randomNumber) % a.length; return a[index]; } this has no reference to an actual random number. i just tr...
- Tue Jul 07, 2009 12:48 pm
- Forum: Challenges Solved
- Topic: Random Problem
- Replies: 11
- Views: 949
- Fri Jul 03, 2009 4:54 pm
- Forum: Challenges Solved
- Topic: Primal Pi
- Replies: 8
- Views: 656
- Fri Jul 03, 2009 2:18 am
- Forum: Challenges Solved
- Topic: Random Problem
- Replies: 11
- Views: 949
Random Problem
I don't know Java much... I did mostly Scheme, and a bit of C.
Anybody care to explain why -2^31 failed?
Thx
Anybody care to explain why -2^31 failed?
Thx
- Mon Jun 22, 2009 11:43 pm
- Forum: Challenges Solved
- Topic: Telecran
- Replies: 24
- Views: 2015
- Thu Dec 11, 2008 2:59 am
- Forum: General Puzzles
- Topic: Automatic submitting
- Replies: 4
- Views: 21836
wow thanks o.O i'm learning so much here its incredible... i'll play around to get familiar with this.. right now i'm working on an efficient Runaway algorithm (still in scheme though...). if its actually as good as i'm thinking it is, it should get me up to 513 like all of you up there :P oh and bt...
- Wed Dec 10, 2008 11:40 pm
- Forum: General Puzzles
- Topic: Automatic submitting
- Replies: 4
- Views: 21836