r1, r2 = formulas[metal]
if r1 in encountered or r2 in encountered:
return False
Adding the above two lines with get your solution pass the first two data
sets.
Basically if either r1 or r2 is one of the metal you encountered before,
you don't really want to use any of them to make a new metal.
Your solution will still run out of time for the hardest data set.
Yngve Ådlandsvik <[email protected]>于2018年5月1日周二 下午1:36写道:
> Here's my Transmutation code:
>
> https://gist.github.com/ymgve/5390788df398e95796d26002466d592d
>
> Why does this fail? I've looked at other people's solutions and it's
> basically the same as mine.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/d44412bd-6d0c-4d5f-8ac2-78330f44e380%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/CAGDEU-Jyyv6eQF0rMtmCSkYLPk2T_UYSTHKza0WLjqwh3tAG-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.