得分:37 43
+>-,->,+-><->-[>---+-+<[--->>+><,+>>>++<><<<+<[>--]]><><+-+>+<<+<><+++<[[<[---->-<-]>++>],>,]<,]<+-.
编辑:现在我的程序允许一些方括号。它不会赢得任何奖项,但这就是我得到一些加权RNG为我忙的工作。
这是由我用C编写的程序生成的。
对于每个N
删除的字符,输出如下:
N = 0 => 158
N = 1 => 158
N = 2 => 158
N = 3 => 187
N = 4 => 129
N = 5 => 100
N = 6 => 158
N = 7 => 13
N = 8 => 1
N = 9 => 211
N = 10 => 129
N = 11 => 1
N = 12 => 57
N = 13 => 255
N = 14 => Mismatched Braces
N = 15 => 59
N = 16 => 11
N = 17 => 11
N = 18 => 11
N = 19 => 117
N = 20 => 11
N = 21 => 117
N = 22 => 166
N = 23 => Mismatched Braces
N = 24 => 206
N = 25 => 206
N = 26 => 206
N = 27 => 147
N = 28 => 147
N = 29 => 158
N = 30 => 148
N = 31 => 188
N = 32 => 51
N = 33 => 17
N = 34 => 84
N = 35 => 84
N = 36 => 84
N = 37 => 158
N = 38 => 158
N = 39 => 94
N = 40 => 46
N = 41 => 94
N = 42 => 94
N = 43 => 94
N = 44 => 17
N = 45 => 196
N = 46 => Mismatched Braces
N = 47 => 149
N = 48 => No Termination
N = 49 => No Termination
N = 50 => Mismatched Braces
N = 51 => Mismatched Braces
N = 52 => 45
N = 53 => 77
N = 54 => 45
N = 55 => 77
N = 56 => 50
N = 57 => 209
N = 58 => 50
N = 59 => 251
N = 60 => 249
N = 61 => 99
N = 62 => 99
N = 63 => 117
N = 64 => 89
N = 65 => 207
N = 66 => 89
N = 67 => 115
N = 68 => 115
N = 69 => 115
N = 70 => 95
N = 71 => Mismatched Braces
N = 72 => Mismatched Braces
N = 73 => 104
N = 74 => Mismatched Braces
N = 75 => No Termination
N = 76 => No Termination
N = 77 => No Termination
N = 78 => No Termination
N = 79 => Left Overflow
N = 80 => 3
N = 81 => 2
N = 82 => No Termination
N = 83 => Mismatched Braces
N = 84 => No Termination
N = 85 => 133
N = 86 => 133
N = 87 => 0
N = 88 => Mismatched Braces
N = 89 => 158
N = 90 => 0
N = 91 => 4
N = 92 => Mismatched Braces
N = 93 => 0
N = 94 => 158
N = 95 => Mismatched Braces
N = 96 => 0
N = 97 => 157
N = 98 => 159
N = 99 => None
共有37个唯一输出,按数字顺序排列:
0, 1, 2, 3, 4, 11, 13, 17, 45, 46, 50, 51, 57, 59, 77, 84, 89, 94, 95, 99,
100, 104, 115, 117, 129, 133, 147, 148, 149, 157, 158, 159, 166, 187, 188,
196, 206, 207, 209, 211, 249, 251, 255
我90% 100%确信此解决方案不是最佳解决方案,但事实证明可能非常困难。有几件事很清楚。.
直到最后一个字符都没有符号似乎是可行的方式,方括号([]
)似乎毫无用处。我在这里做了一些思考,我想概述一下:
让L
是代码的以字节为单位的长度(在挑战,100
),并且n
是子节目的唯一输出的数目。
为L=3
,存在的形式的几个最优解+-.
,其中n=2
(在这种情况下,输出是1和255 +.
和-.
分别。)这使得最佳比L = 3
在n/L = 66.67%
。请注意,至少不能超过该比率L<10
。
对于L=10
,解决方案非常简单,足以对其进行暴力破解。以下是所有最佳解决方案n = 6
:
++>-->+<+. => 6
++>-->+<+. => 6
+++>->+<+. => 6
--->->+<+. => 6
++>---><+. => 6
+++>--><+. => 6
-->++>-<-. => 6
+++>+>-<-. => 6
--->+>-<-. => 6
-->+++><-. => 6
--->++><-. => 6
得出的得分率为n/L = 60%
。
如L->infinity
,很明显的是,比率必须为潜在的无限接近0,由于只有255种可能的输出L
。
但是,该比率不会均匀降低。不可能构造的解决方案n=6, L=9
,因此的最佳可能比率L=9
是5/9 = 55.56% < 60%
。
这就引出了一个问题,比率下降的速度有多快?对于L = 100
和10^9 checks/second
,要强求最优解,将比宇宙的寿命长几个数量级。有没有解决此问题的优雅方法?我非常怀疑这归结37%
为原因L = 100
。
该比率实际上增加到L=100
。查看其他答案以确认。
我很想听听您对以上内容的评价。毕竟我可能是个大错。