Saturday, November 23, 2013

November 2013 Bronze (Correction 2) Problem 1: Combination Lock

Result: 10/10 **********

This is more optimized than my previous correction though still in O(1) time.

combo2.cpp

November 2013 Bronze (Correction) Problem 1: Combination Lock

Result: 10/10 **********

Upon review, I beat the solution! Though N is no larger than 100, my solution runs in O(1) time and theirs runs in O(N^3) time.

combo2.cpp

Tuesday, November 19, 2013

November 2013 Bronze Problem 3: Farmer John has no Large Brown Cow

Result: 3/10 **ssx*ssss

I somehow ran out of memory and the permutations were not correct in one case.

nocow.cpp

November 2013 Bronze Problem 2: Goldilocks and the N Cows

Result: 7/10 *******ttt

I think that testing every boundary line might be slow, but it's the only way I can think of that does it completely.

milktemp.cpp

November 2013 Bronze Problem 1: Combination Lock

Result: 4/10 *x*xxxx**x

I optimized it near the end, but then I realized that the overlap() function fails when N < 5.

combo.cpp