Search found 22 matches

by SnapDragon
Thu Jun 26, 2008 12:23 am
Forum: General
Topic: Invitation to Google Code Jam 2008
Replies: 0
Views: 2790

Invitation to Google Code Jam 2008

Do you find yourself debugging in your sleep? Enjoy solving tough problems and grappling with technical challenges? Then enter Google Code Jam and compete for more than $80,000 in cash prizes! Google Code Jam is an annual competition in which programmers – both students and professionals – are chall...
by SnapDragon
Thu Jun 26, 2008 12:20 am
Forum: Other words
Topic: Invitation to Google Code Jam 2008
Replies: 0
Views: 2721

Invitation to Google Code Jam 2008

Do you find yourself debugging in your sleep? Enjoy solving tough problems and grappling with technical challenges? Then enter Google Code Jam and compete for more than $80,000 in cash prizes! Google Code Jam is an annual competition in which programmers – both students and professionals – are chall...
by SnapDragon
Wed Apr 02, 2008 11:57 pm
Forum: Volume 114 (11400-11499)
Topic: 11425 - Collecting Luggage EXTREME!!!
Replies: 1
Views: 1000

Re: 11425 - Collecting Luggage EXTREME

Your case 2 output looks quite off.
by SnapDragon
Wed Aug 13, 2003 7:39 pm
Forum: Volume 105 (10500-10599)
Topic: 10538 - Powerful Magic Squares
Replies: 7
Views: 3200

Hehe. I should have explained that that's how I actually did solve the problem. My not-really-optimized search took an hour (though I did remove translations and reflections by fixing a 1 in the upper-left corner, and applying two A > B restrictions to the 4 numbers adjacent to the 1). You need to p...
by SnapDragon
Thu Aug 07, 2003 6:34 pm
Forum: Volume 105 (10500-10599)
Topic: 10538 - Powerful Magic Squares
Replies: 7
Views: 3200

The only way I could see to solve this in a real contest would be to run a search for all the magic squares (eliminating translations/reflections) for an hour or so, put them into a table, and look them up for each example. This still isn't fast enough because of the 15,000 cases, though, so you'd n...
by SnapDragon
Tue Apr 29, 2003 8:04 pm
Forum: Volume 1 (100-199)
Topic: 199 - Partial differential equations
Replies: 15
Views: 4323

Technically, the final row of output should be
-15 -168 -221 -347
Since the "f" function is specified as being given in order of increasing y from top to bottom. But your output is what ends up accepted. :-?

To avoid the PE, put a space after each line of numbers.
by SnapDragon
Mon Apr 14, 2003 9:19 pm
Forum: Volume 104 (10400-10499)
Topic: 10483 - The Sum Equals the Product
Replies: 21
Views: 10866

Make sure you're sorting them correctly. 35.91, for instance, has 3, and they should be in the order "0.21 + ..." "0.50 + ..." "0.76 + ...".
by SnapDragon
Fri Jan 24, 2003 11:41 pm
Forum: Algorithms
Topic: A difficult problem which no one haven't solve
Replies: 4
Views: 2842

Here's my code, if someone wants to tweak it. #include <cstdio> #include <map> using namespace std; typedef signed long long i64; int size; map<i64, double> memo; double nmat(i64 x) { double &ret = memo[x]; if( ret != 0.0 ) return ret-1; ret = 1; int d = (x>>(2*size)); if( d == size*size ) return (r...
by SnapDragon
Fri Jan 24, 2003 11:36 pm
Forum: Algorithms
Topic: A difficult problem which no one haven't solve
Replies: 4
Views: 2842

I tried a short DP algorithm (looking at the matrix as a string of length n^2, only the last 2n choices are relevant to any remaining choices.) Made it up to 11 before running out of memory. I'm not sure how you'd improve this. (I used doubles instead of BigInts, so the last answer's inexact :)) siz...
by SnapDragon
Tue Jan 14, 2003 8:50 pm
Forum: Volume 103 (10300-10399)
Topic: 10383 - Queen vs Rook
Replies: 8
Views: 3607

I get 35 as well. It sounds like your search is correct; my guess is that you have some minor error when outputting the winning moves? Something cosmetic, anyway.
by SnapDragon
Tue Jan 14, 2003 8:33 pm
Forum: Volume 103 (10300-10399)
Topic: 10399 - Optimus Prime
Replies: 14
Views: 5114

Here's how I thought about it when I made the problem. For each prime p, we determine the _unique_ first move for A that will allow A to force taking p. The reason that it is unique is simple: suppose A could pick both 'x' and 'y' as his first move to force taking p, with x < y. Then when A picks x,...
by SnapDragon
Tue Nov 12, 2002 2:06 am
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 28745

Try the following input:
a
(blank line)
a
a
a
(blank line)
by SnapDragon
Mon Nov 11, 2002 7:54 pm
Forum: Volume 104 (10400-10499)
Topic: 10410 - Tree Reconstruction
Replies: 13
Views: 9082

It's a little-known fact that Yarin's phrase "I noticed my program was wrong", when used in this context, ACTUALLY means "SnapDragon pointed out that my program was wrong". ;)
by SnapDragon
Fri Nov 08, 2002 8:25 pm
Forum: Volume 8 (800-899)
Topic: 809 - Bullet Hole
Replies: 6
Views: 5323

I avoided using floating point whenever possible. I determine whether the ray intersects individual cubes wholly with integer arithmetic; the only doubles I use are for calculating how high up on the cube the intersection point is. You have to remember a few important facts about fluid dynamics. Sup...
by SnapDragon
Fri Nov 08, 2002 7:49 pm
Forum: Volume 103 (10300-10399)
Topic: 10395 - Titans in Danger
Replies: 18
Views: 3170

This question is horribly badly worded... he WANTS you to choose your permutations in a certain way, but he gives you absolutely no useful description of what that way is, and the sample output he gives you isn't sufficient. As was pointed out, the sample output has gurcoth-gcruoth when gurcoth-curg...

Go to advanced search