Result: 10/10 **********
This is more optimized than my previous correction though still in O(1) time.
combo2.cpp
C++ solutions, both training and real, are posted when possible; they are provided for reference purposes only.
Saturday, November 23, 2013
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
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
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
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
I optimized it near the end, but then I realized that the overlap() function fails when N < 5.
combo.cpp
Subscribe to:
Posts (Atom)