Cody

Rafael Siqueira Telles Vieira

125
Rank
30
Badges
5925
Score
1 – 50 of 790

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44316. Pandigital Multiples of 11 (based on Project Euler 491)

Pandigital number of order 10 has two 0s and one 1 Pandigital number of order 11 has two 0s and two 1s Pandigital number of order 12 has two 0s, two 1s and two 2s Pandigital number of order 13 has two 0s, two 1s, two 2s and two 3s and so on...It wasn't clear to me at first, and I didn't find on the net anything about the order of pandigital numbers. Moreover, If one needs more examples: pandigit11(9) = 285120; and pandigital(12) = 59875200.

11 hours and 40 minutes ago

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44376. The sliding puzzle: 3D

Good problem. Tip: use the L1-norm or manhattan distance using the 3 indexes as a cost function.

22 hours and 14 minutes ago

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44374. Tautology

It would be a good measure to add operator precedence to the problem description since the author is requesting a parser. We cannot assume every language is the same. Imho, a tautology is true regardless of the order that we evaluate it such as A|~A or ~0. If there is a way to make it false, then it is not a tautology. And different languages may evaluate it differently.

on 9 Jul 2020 at 16:51

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44343. Pair Primes

Good problem. At first, I thought we needed to reverse the numbers, but only their order is necessary. And we need to count twice numbers like 31 and 13.

on 9 Jul 2020 at 16:34

Rafael Siqueira Telles Vieira submitted a Comment to Problem 337. Number of toolboxes?

The answer should be 0. It is written on the FAQ: "Cody supports MATLAB and not the toolboxes".

on 8 Jul 2020 at 20:08

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44337. Sums of Distinct Powers

It is not clear at all, James, that we must sum all possible unique combinations of exponents for a base. However, it is a good problem.

on 8 Jul 2020 at 20:02

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44337. Sums of Distinct Powers

The problem wants all unique combinations of distinct powers of a given base up to a point. If we forget some factors it will overflow, if we repeat sequences, their sum will not match the test cases. that means 0 1 2 3 1 0 2 0 2 1 3 0 3 1 3 2 2 1 0 3 1 0 3 2 0 3 2 1 and so on (and resulting numbers must be sorted if we are not following their natural order)

on 8 Jul 2020 at 19:56

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44365. An asteroid and a spacecraft

An interesting test case, for instance, would be (that my solution and many others would fail): p0 = [1, 0, 0]; p1 = [ -1, 0, 0]; p2 = [ 0, 1, 0.5]; p3 = [ 0, -1, 0.5]; t0 = 0; t1 = 1; d = 1; ok = false; At half-way their path, asteroid and spacecraft will be at distance 0.5 of each other, violating the safe distance d=1, and without crossing paths.

on 8 Jul 2020 at 17:19

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44365. An asteroid and a spacecraft

This problem needs more test cases. My solution probably is not general, but it works without using all of its tests.

on 8 Jul 2020 at 17:01

Rafael Siqueira Telles Vieira submitted a Comment to Solution 1325665

It is not a general solution. It would fail on: x = [ 1 1 -1; -1 1 -1; -1 1 0]; y_correct = 0; PS: The game ended but O kept on playing.

on 8 Jul 2020 at 7:14

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44382. Parse me a Lisp

Good problem, and better than 44374. Precedence is clear.

on 8 Jul 2020 at 2:40

Rafael Siqueira Telles Vieira submitted a Comment to Solution 1321395

Using str2num is a hack to bypass the rules that forbid using eval.

on 7 Jul 2020 at 23:14

Rafael Siqueira Telles Vieira submitted a Comment to Solution 1321278

It is correct because of A|~A, the other letters won't matter since is a or.

on 7 Jul 2020 at 23:13

Rafael Siqueira Telles Vieira submitted a Comment to Solution 1297342

Although is a creative solution, the function str2num should be banished from Cody since eval is not allowed.

on 7 Jul 2020 at 23:09

Rafael Siqueira Telles Vieira submitted a Comment to Problem 44374. Tautology

This question ignores operator precedence, and imho that's just evil. All compilers that I know of use operator precedence because if they don't that leads to contradictions. Test cases 49 & 51 demonstrates this: (1|A&0) is a tautology only if evaluated from right to left (1|0 -> 1, but 1&0 -> 0), and (A&~A|1) is a tautology only if evaluated from left to right (0|1 -> 1, but A & 1 -> 0). Assuming that & and I have the same precedence.

on 7 Jul 2020 at 22:13

1 – 50 of 790