Cody

Alfonso Nieto-Castanon

2
Rank
48
Badges
31335
Score

Activities

1 – 50 of 5,597

Alfonso Nieto-Castanon received Number Manipulation II Master badge

18 hours and 32 minutes ago

Alfonso Nieto-Castanon received Magic Numbers II Master badge

18 hours and 34 minutes ago

Alfonso Nieto-Castanon received Indexing IV Master badge

on 1 May 2018 at 15:15

Alfonso Nieto-Castanon submitted a Comment to Solution 1363558

The solution is timing out (it is just taking too long). I would recommend to change your code to use a single call to dijkstra_lanes instead of one separate call for each StartLane-to-EndLane combination. You may do so, for example, by adding two nodes to your graph, one "start" node that is connected (with distance 0) to every non-blocked lane in the first row, and one "end" node that is connected (with distance 0) to every non-blocked lane in the last row. Then you will only need to call dijkstra_lane once to compute the optimal path distance of this extended graph, instead of calling your function N1*N2 times (for each of the N1/N2 first/last -row non-blocked positions)

on 29 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1391305

@Daniel, this cheat does not work because user directories are effectively random (hint: you may simply use relative paths instead). In any way, this form of cheats/hacks are not welcome in this particular Cody problem. There are, nevertheless, plenty of hacking problems in Cody (e.g. https://www.mathworks.com/matlabcentral/cody/problems?term=tag%3Ahack) that welcome and even encourage this sort of explorations, so please use those venues instead if you are interested.

on 23 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44377. Five steps to enlightenment

@Thomas: fair enough, I changed the wording of the third sentence to try to make it less ambiguous (also note that there are several clarifications in the text regarding how to properly interpret sentence #3, starting from "and c) the third sentence refers to ..." as well as "In Step 3, S asserting ... tells us that ...")

on 22 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44377. Five steps to enlightenment

@Thomas, this is certainly a source of cofusion (see most comments above). To clarify, Scott statement in Step 3 refers to his knowledge state at the onset of this exchange about what Priscilla knew at that same time. In other words, Scott learns at the onset that the sum is 22. He considers that the pairs must be either (4,18) or (6,16). He then works each of these two cases and deduces that, if the pair was (4,18), then Priscilla would have been told P=72, and with this information she would only know that the solution is either (4,18) or (6,12); and if the pair was instead (6,16) then Priscilla would have been told P=96, and with that information she would only know that the solution is either (6,16) or (8,12). In both cases Priscilla could not have deduced the solution from knowing the product P alone, so Scott can safely deduce that Priscilla did not know the solution at the onset (which is what he states at Step 3; he already knew that she did not know). After Scott states that he does not know the solution in Step 1, Priscilla learns some new information, which allows her to rule out (6,12), which changes the logic above, but that information is not part of Step 3 statement (Scott is not saying that he knew that Priscilla could not have known the solution after hearing Scott's statement #1, he is saying that he knew that Priscilla could not have known the solution at the onset). Hope this clarifies

on 20 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1381957

almost there, I added a few comments in the testsuite in tests 21-26 to help you debug

on 16 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1379655

added a few more test cases to discourage look-up table solutions

on 15 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44378. Five-dimensional maze

@Ziheng, you are interpreting the order of the dimensions in reverse. In general, if the wall encoding is x, then bitget(x,n) will be 1 if there is a wall along the n-th dimension/direction. The x=15 (#01111) encoding means that the fifth dimension is open (bitget(15,5)==0), while the first to fourth dimensions are closed (bitget(15,1:4)==[1 1 1 1]) , so you are allowed to travel along the length of this tube.

on 12 Dec 2017

Alfonso Nieto-Castanon received Computer Games I Master badge

on 7 Dec 2017

Alfonso Nieto-Castanon received Strings III Master badge

on 7 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 55985

@yurenchu, Thanks for pointing this out, I have added a few more test cases now

on 4 Dec 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1361989

thanks for pointing this out, I fixed that now

on 29 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1355443

added a few more test cases to discourage look-up table solutions (by I liked your bin2dec idea to encode the board, I copied that in my testsuite now :)

on 23 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1354397

wow, I love everything about this solution, the equivalence with a 3x9 board, the BubbleSort strategy, even the 190-size :)

on 23 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44340. Recaman Sequence - III

(otherwise a perfectly valid answer would be to use a seed = 1+n^2/2-n/2 which always results in a Recaman sequence with a 1 in the n-th position)

on 23 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44340. Recaman Sequence - III

that said, his general comment still stands that the solutions to this problem are often not unique (several different sequences will contain a 1 in the n-th position) so the problem statement perhaps should clarify that you are asking for the 'lowest integer' to start a Recaman sequence containing a 1 in the n-th position (or something along these lines)

on 23 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Problem 44340. Recaman Sequence - III

David sequence examples are incorrect, the series cannot have repeated 1's (by definition, it is possible to have repeated elements but not repeated 1's). For example, the sequence starting with 1 would be [1 2 4 7 3 8 14 21 13 22 12 23 11] instead of [1, 2, 4, 1, 5,10, 4,11, 3,12, 2,13,1] as David suggests (e.g. after [1 2 4], 4-3 appears already in the sequence so it jumps to 4+3 instead)

on 23 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1351541

if you are feeling overwhelmed by a particularly persistent cheater just know that you can ban a player from your own problems by adding to your testsuite something like: lines=textread('groupDist.m','%s'); id=str2num(regexp(lines{end},'\d+','match','once')); assert(~ismember(id,[123456789 234567890]),'banned player id'); (where the array in the ismember line contains the list of player ids that you want to ban from your problem -e.g. my player id is 1379371; please do not ban me :)

on 21 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1352215

scenario #1: you run into a problem that you really like but no matter how hard you try you do not seem to be able to figure out how to solve it. You are ready to "give up" but would *really really really* like to see other players' solutions and learn from them. Unfortunately Cody does not let you see other people's solutions until you provide one of your own. A freepass allows you to bypass this restriction (from time to time and with a little effort from your side so it does not break the logic/motivation of the game)

on 21 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1350166

and this?

on 21 Nov 2017

Alfonso Nieto-Castanon submitted a Comment to Solution 1348113

can you do better than this?

on 21 Nov 2017

1 – 50 of 5,597