压缩原子电离能


22

这是另一种类型的压缩挑战。在正常的挑战中,您需要精确地重新创建列表。在这里,您可以按任何希望的方式舍入值。有什么收获?您的分数将根据输出的错误程度而受到处罚。

这个问题的底部是前108个元素的第一电离能的列表。您的程序在执行后应输出此列表的相当准确的副本。将没有输入或参数。出于评分目的,您的输出应该是确定性的(每次输出相同)。

输出格式

您的程序/函数必须输出108个数字的列表,并按原子序数递增的顺序排序。该列表可以采用任何适当的格式。下面的源数据以正确的顺序提供,从氢到has。

计分

您的分数将是您程序的长度(以字节为单位)加上一个四舍五入的罚款。 为每个元素计算一个舍入罚款,并将其相加得出总罚款。

举个例子,我们以数字为准11.81381。假设您的程序输出的值不正确11.81299999

  1. 首先,两个数字都乘以相同的10的幂,以使真实值中不再有小数点:1181381, 1181299.999。真实值中的结尾零被认为是重要的。

  2. 然后,采用绝对差确定绝对误差:81.001

  3. 最后,我们将该元素的惩罚计算为max(0, log10(err * 4 - 1)) -> 2.50921。选择该公式时,误差<0.5不会造成任何惩罚(因为四舍五入后的答案是正确的),同时还可以使该数字四舍五入到任何特定的小数位将带来净收益(渐近)的可能性为50%渐近其他压缩)。

这是罚款计算程序的在线试用实现。该程序的输入以数字列表的形式提供,每行一个。该程序的输出是总罚分和每个元素的得分明细。

数据

以下数字列表是目标数据,从原子序数1到108的正确顺序。

资源

13.598434005136
24.587387936
5.391714761
9.322699
8.2980190
11.260296
14.53413
13.618054
17.42282
21.564540
5.1390767
7.646235
5.985768
8.151683
10.486686
10.36001
12.96763
15.7596112
4.34066354
6.11315520
6.56149
6.82812
6.746187
6.76651
7.434018
7.9024678
7.88101
7.639877
7.726380
9.3941990
5.9993018
7.899435
9.7886
9.752392
11.81381
13.9996049
4.177128
5.69486720
6.21726
6.63390
6.75885
7.09243
7.11938
7.36050
7.45890
8.33686
7.576234
8.993822
5.7863552
7.343917
8.608389
9.00966
10.45126
12.1298431
3.893905548
5.211664
5.5769
5.5386
5.473
5.5250
5.582
5.64371
5.670385
6.14980
5.8638
5.93905
6.0215
6.1077
6.18431
6.254159
5.425871
6.825069
7.549571
7.86403
7.83352
8.43823
8.96702
8.95883
9.225553
10.437504
6.1082871
7.4166796
7.285516
8.414
9.31751
10.7485
4.0727409
5.278424
5.380226
6.3067
5.89
6.19405
6.2655
6.0258
5.9738
5.9914
6.1978
6.2817
6.3676
6.50
6.58
6.65
4.90
6.01
6.8
7.8
7.7
7.6

基准和提示

上面的源数据是906字节,某些压缩工具能够将其压缩到500字节以下。有趣的解决方案是那些尝试执行智能舍入,使用代数公式或其他技术以比单独压缩更少的字节输出近似值的解决方案。但是,很难判断这些跨语言的折衷:对于某些语言而言,仅压缩可能是最佳选择,而许多其他语言可能完全缺少压缩工具,因此我希望跨语言的评分会有很大差异。很好,因为我遵循“语言内部竞争,而不是语言之间竞争”的哲学。

我预计尝试利用周期表中的趋势可能会有用。下面是我发现的电离能图,因此您可以看到其中一些趋势。

在此处输入图片说明


2
嗯,图表显示了一些有趣的趋势,也许对压缩很有帮助……
Erik the Outgolfer

3
旁注:这是一个相当实验性的挑战。计分方案是独特的,我希望它能很好地完成。
PhiNotPi

非常好的挑战。不幸的是,参考的准确性如此之高,以至于基于物理的逼近公式(实际上不能期望预测两个以上的数字)几乎没有机会与数字的字面压缩竞争。(当然,实际上简短地解决了Schrödinger方程,这也不是很可行。)如果在惩罚公式中没有对数,则IMO会变得更加有趣,因此高位数字实际上对于正确计算更为重要。

@PhiNotPi计分方案不是那么独特,对吧
硕果累累'18

1
@EsolangingFruit是的,我看到了相似之处。我认为这是唯一的,因为惩罚是“连续的”,这意味着您对任何特定输出都不单是对还是错,因此,它是关于查找每个数字应加多少的事情。(这种评分方案在2015年我第一次沙盒化时就更加独特了,大声笑。)
PhiNotPi

Answers:


6

干净,540字节+ 64.396 罚款 = 604.396

注意: 为了便于阅读,我将[Char]字面量中的每个字节都转义了,因为它们大多数都是不可打印的。但是,由于Clean会自然地独立获取编码的源文件(空值除外),因此每个转义符仅计为每个转义字节(空值,引号和换行符除外)。

import StdEnv,GenLib
c[h:t]=[(toInt h>>i)rem 2\\i<-[0..7]]++c t
c[]=[]
r[]=[]
r l=[7<<29+2^62+sum[d<<p\\d<-l&p<-[32..53]]:r(drop 22l)]
u::Maybe[Real]
u=uncompress{e\\e<-[108:r(c['\145\062\353\227\045\336\021\131\341\224\212\225\230\140\121\241\231\027\321\306\361\254\075\154\161\041\144\255\346\110\371\126\172\155\361\127\152\023\350\222\117\116\341\222\155\357\351\072\341\153\315\025\171\317\141\367\076\232\377\323\206\301\257\235\103\154\157\274\035\010\347\167\142\370\355\074\172\320\347\036\165\262\210\364\177\025\144\176\303\223\143\116\340\270\012\172\062\377\257\141\265\320\342\261\225\347\215\165\044\152\017\011\133\251\027\347\243\307\231\304\165\351\325\035\036\053\010\341\344\131\363\207\072\045\327\012\130\347\167\023\312\023\210\013\347\244\236\020\172\153\362\370\142\123\276\116\226\341\211\245\105\136\145\146\130\367\123\026\312\244\225\347\152\225\145\142\207\164\227\145\360\105\140\201\041\271\141\273\274\230\020\101\166\101\133\171\063\155\302\062\036\061\335\147\130\365\175\201\203\035\357\341\272\172\270\067\047\002\200\223\342\156\230\253\152\347\105\322\335\117\203\220\242\342\316\137\311\247\004\155\164\124\131\205\325\203\116\306\365\170\325\032\143\337\017\331\232\006\266\122\176\305\334\137\214\312\130\035\110\306\206\227\001\000\150\353\121\132\146\246\226\231\071\365\050\140\063\063\333\314\314\307\314\354\231\231\171'])]}

在线尝试!

这是我能够利用Clean的通用压缩功能(技术上实际上不是压缩,而是二进制序列化)获得实际收益的第一个挑战。

我从一个[Real]-列出问题中的64位浮点数开始。序列化此列表后,我简化了前10位(每个数字都相同),并将后32位的最佳配置简化为常数7<<29+2^62。每个数字剩余的22位分别转换为2.75个字符,并编码为字符串。

这样,整个压缩常数只有302个字节,包括每次转义!


1
也许您可以使用CleanSnappy获得更好的压缩效果;cloogle.org/src/#CleanSnappy/Snappy / github.com/camilstaps/CleanSnappy

5

Python 3中355个+ 202个 353字节+ 198罚分= 551

for i in'趐￵㠡愍噢甹靍跄땠㖀侙㹐哜洫毙蛿ꐏⴰ㾤䑎䜕䘻䙱䵤剄刋侈偯懌㹴刼旧斆竼醽⭼㭉䂹䔏䙜䧕䨝䲠䶦囊仟嶡㰽䱴妝巋泍繆⢉㙁㨎㦨㣺㦄㨜㫀㬈䀅㴋㷔㺯㾕䁡䄛㡼䜍亘凞册埘嵙嵃怊沨㾗䴵䯘垗惿濥⩦㛳㠂䆧㵑䁻䄺㺻㸰㹟䂅䅥䉊䎫䒀䔺㌃㺑䛊儳倩伞':print(ord(i)/2665)

在线尝试!

我将其0xffff (65535)用作上限,因为它是可以存储在单个3字节unicode字符中的最大值。
由于最高电离能为〜24.587,因此比例为2665
为了生成字符串本身,我使用了代码段''.join([chr(int(round(n*2665)))for n in ionization_energies])(在python2上需要使用unichr),您的控制台可能会也可能无法打印字符。


4个字节的字符,462个字节+ 99罚分= 561

for i in'򖛬􏿸𻩕񧈞񛳀񼤓򠲊򖩥󀯗󮣬𸶞񔥢񂍻񚋙񴀥񲦹򏝅򮕴𰁌񃨇񈥢񋢔񊨓񊶬񒏒񗚽񗋰񔡂񕞒񧻆񂗠񗘳񬒕񫸬򂬋򚷮𮍚𾿾񄱴񉘳񊱑񎝜񎰡񑛏񒠺񜎠񓳾񣟨񀀯񑏠񟎯񣪶񳧟򆋻𫄹𹩷𽬜𽑕𼢹𽇭𽰄𾛰𾮨񄂄񀷥񁬶񂧎񃤐񄚟񅋼𼁡񋠊񓡆񖿯񖪈񝖑񣌪񣆷񦃬񳝰񃤫񒃁񐦉񝅇񧄳񶹼𭃠𺙈𻡍񅱉񁊈񄡙񅓾񂪑񂅝񂑺񄤃񅟜񆜑񇺀񈲩񉤍𶍍񂟅񋎚񖒚񕋦񔄳':print(ord(i)/45312)

在线尝试!
相同的想法,但最大值是0x110000


为什么一个三字节的unicode字符只能存储0x100**2值而不能存储值0x100**3
乔纳森·弗雷希

我要说的是,目前已知的最高原子序数是118-在这种情况下,要考虑的最高原子序数是108-,而不是〜24。您可能是用eV表示电离能。
乔纳森·弗雷希

@JonathanFrech有一点:UTF-8在这里是一个不好的选择。其他编码更有效。
丹尼斯

4

C,49字节+ 626.048罚款= 675.048

f(i){for(i=0;i<108;)printf("%f\n",5.5+i++/13%2);}

在线尝试!


5
37个字节:f(i){for(i=0;i++<108;)printf("6\n");}; 罚款:625.173330827107;总计= 662,173330827
Tsathoggua

1
@Tsathoggua嗯,我以为我尝试了这一点,得到了更高的罚款。我想我错了。f(i){for(i=0;i<108;)puts("6");}在31个字节中执行相同的操作。
Steadybox

您需要i++太(在“31”),但f(i){for(i=108;i;i--)puts("6");}确实32
乔纳森·艾伦

2
@乔纳森·艾伦·胡普斯。f(i){for(i=108;i--;)puts("6");}得到它回落到31
Steadybox

4

CJam(389字节+ 33.09罚款=> 422.09)

xxd编码:

0000000: 2256 3232 7c24 1bf9 7116 2f43 c82b 110e  "V22|$..q./C.+..
0000010: 6b93 4525 1cb3 4118 4afc 4d05 5c22 e15a  k.E%..A.J.M.\".Z
0000020: 11bc 563c 38e4 626c 1efb 6b10 c229 0e35  ..V<8.bl..k..).5
0000030: 873d 15df 2f71 36ca 404d 54d9 4979 17ba  .=../q6.@MT.Iy..
0000040: 4938 a953 6fb6 5f04 75f0 5c22 5c6b 39e5  I8.So._.u.\"\k9.
0000050: 3073 6fbd 343e fb36 4fff 357c 8c36 10f3  0so.4>.6O.5|.6..
0000060: 3b3c 37cd 3f1c 10a1 3f06 933d 0f1d fa3d  ;<7.?...?..=...=
0000070: 67e8 4549 6a9c 2f7f 24be 3f99 4713 e147  g.EIj./.$.?.G..G
0000080: 011c e14f 20d5 577f 668d 2135 30c2 2d47  ...O .W.f.!50.-G
0000090: 45d1 315e bc35 8936 0987 385e d238 7a9f  E.1^.5.6..8^.8z.
00000a0: 3af1 3b55 f441 2cbc 3c4e 8843 7ceb 2e25  :.;U.A,.<N.C|..%
00000b0: 1d93 3a60 15f1 4237 3fb0 4404 f949 e750  ..:`..B7?.D..I.P
00000c0: 423d b21e 265b 7cf6 2958 df2c 4edf 2c27  B=..&[|.)X.,N.,'
00000d0: c32b e42c 992c d32d 1394 2d2e 3cd9 3119  .+.,.,.-..-.<.1.
00000e0: b22e 74c3 2f41 cb30 9630 6ea4 313c dd32  ..t./A.0.0n.1<.2
00000f0: 04a1 2b34 0be1 364c 6fb8 3c32 61af 3e74  ..+4..6Lo.<2a.>t
0000100: e23e 55c3 4160 af43 6f8e 436a f544 733d  .>U.A`.Co.Cj.Ds=
0000110: eb49 e030 6e71 b43b 2ad7 3a24 af41 d345  .I.0nq.;*.:$.A.E
0000120: 5c22 c84a 7f9d 204a 3ea5 2a1d 0dcb 2b05  \".J.. J>.*...+.
0000130: 2cfd 32ba af31 46da 320f ef30 1ab5 2fe5  ,.2..1F.2..0../.
0000140: 2ff7 314a c632 20ba 3278 b6b4 34d1 b5a7  /.1J.2 .2x..4...
0000150: b0b6 bebd bc22 7b69 3235 362b 3262 283b  ....."{i256+2b(;
0000160: 287d 2531 6125 7b32 253a 2b5f 323e 315c  (}%1a%{2%:+_2>1\
0000170: 2b32 6232 405f 2c33 2d5c 323c 3262 2d23  +2b2@_,3-\2<2b-#
0000180: 642f 4e7d 2f                             d/N}/

基本上这是

"MAGIC STRING"{i256+2b(;(}%1a%{2%:+_2>1\+2b2@_,3-\2<2b-#d/N}/

这使用自定义的可变宽度浮点格式来存储数字。两位足以满足指数要求;尾数的取值范围是5位到47位,为7的倍数。每个字节的剩余位用作分隔符。

当我复制魔术字符串以进行在线演示时,似乎正在发生一些损坏,因此得分要高出大约2个罚分。我必须弄清楚如何直接构建URL ...


生成程序:

e# Score calculation
{1$`'.+'.%1=,10\#_@*@@*-z 4*1- 0e> ml10ml/0e>}:E;

q~]

e# Custom float format
e# Exponent goes from 2^1 to 2^4, so 2 bits
e# Each byte has 1 bit for continuation, so 7 bits available
e# That means the options for the mantissa are 5 bits, 12 bits, 19 bits, 26 bits, 33 bits, 40 bits, 47 bits
{
  :X
  0\{2/\)\_2<!}g
  e# Stack: exponent mantissa
  2 47#*i2b(;
  e# Stack: exponent mantissa-bits
  W%7/W%Wf%:M
  7,{
    )M<e_
    1_$+2b2@,#d/
  }%
  2 3$#f*
  X\f{E}
  _,,.+
  _:e<
  #)<

  \(4+2b(;\+e_7/
  _,,:!W%\.+2fb:c
}%
""*`

在线演示


自我注意:定点节省大约1点。
彼得·泰勒,

自我注意:调整字符串以除去转义符是否"会使错误增加得太多呢?
彼得·泰勒

4

果冻 379 361  360个字节 + 0 罚金 = 360

使用彼得·泰勒(Peter Taylor)的观察值-18(顺序10的值前导1或2,而顺序1的值不导数)。

<3Ḣ‘_L⁵*×Ḍ
“KẸ⁺dzⱮÑ2⁵İ2ṭ¬⁴²¬¶9°ß°øİẆGẊœ%X(¢ṆḢ/8¬Ɗ’b7µ18,-;_3+\⁺Ṭœṗ“SŒƥŻƭ°}MḋṘḥfyɼ{ṅĊLƝġœ⁺ḟ8ḶhỊDṭ&æ%*ɱ¬ =¦ẉ Qh"¶:ḌĊ€ĖṢė°ġṀƬmẓSṃ÷E⁴Ȥ⁼ḋ#ØĖḂ2øzẸżƈ¥Ȧƥ7¢®|ḳẊṆƙƲɦḟɼṖỊɲṁẉɗ6ẇSɗ⁴ẉİt]ẓeṆHṚƑ½>]ɦ~T¢~ẆẆA`/6ƭṡxṠKG£Ḅ+wḃḣỤw×ḌŻƲF>Ụ]5bJḤḟCḞİḶ|ȥ9Ỵ0ụKṗT⁴ƥƁṖı×ṄtTĊG©ṀḥṬƭʂd½ḊȦуŀṣ¹ʋṖẓYL²ṅṿ&ẏdDṬIɦỵ¹b,ḷṣƭ#P'µ{GTƇẹ¥L8SƥÑṆẈėẎßṀḷƓ⁷ðḳċ¿ḶM_ḲẈg9ḢĠi+LṭẹḲẎ¤g<ṘJJĿßæ⁺(ɲỴ3ɲgkSḃIƙṭ.Ỵ&_:cĿƝı’D¤Ç€

在线尝试!

怎么样?

创建以下两个常量(又称nilads):

  • (A)使用的所有十进制数字(即,所有数字都合并在一起而忽略了它们的连接位置及其小数位分隔符),以及
  • (B)每个数字使用的有效数字的数量

然后使用它们来重构数字的浮点表示。

完整的程序具有以下形式:

<3Ḣ‘_L⁵*×Ḍ
“...’b7µ18,-;_3+\⁺Ṭœṗ“...’D¤Ç€

...用于构造B和A的编码数字在哪里)
,其工作方式如下:

<3Ḣ‘_L⁵*×Ḍ - Link 1, conversion helper: list of digits  e.g. [1,2,9,6,7,6,3]
<3         - less than three?                                [1,1,0,0,0,0,0]
  Ḣ        - head                                            1
   ‘       - increment                                       2
     L     - length                                          7
    _      - subtract                                        -5
      ⁵    - literal ten                                     10
       *   - exponentiate                                    0.00001
         Ḍ - undecimal (convert from base 10)                1296763
        ×  - multiply                                        12.96763
           - i.e. go from digits to a number between 3 and 30

“...’b7µ18,-;_3+\⁺Ṭœṗ“...’D¤Ç€ - Main link: no arguments
“...’                          - base 250 literal = 16242329089425509505495393436399830365761075941410177200411131173280169129083782003564646
     b7                        - to base seven = [2,0,4,3,2,4,2,4,3,2,3,3,4,2,3,5,3,3,0,3,4,2,4,4,1,4,3,4,3,2,1,5,3,5,1,5,0,3,3,3,3,3,3,3,4,3,4,2,3,2,4,5,4,0,1,3,2,4,2,5,4,2,2,4,2,3,4,4,3,3,3,2,3,3,3,3,4,4,3,3,2,0,5,3,5,2,3,1,1,6,2,3,3,3,3,3,3,1,3,3,3,3,2,3,3]
       µ                       - start a new monadic chain, call that x
        18,-                   - integer list literal = [18,-1]
            ;                  - concatenate with x = [18,-1,2,0,4,3,2,4,2,4,3,2,3,3,4,2,3,5,3,3,0,3,4,2,4,4,1,4,3,4,3,2,1,5,3,5,1,5,0,3,3,3,3,3,3,3,4,3,4,2,3,2,4,5,4,0,1,3,2,4,2,5,4,2,2,4,2,3,4,4,3,3,3,2,3,3,3,3,4,4,3,3,2,0,5,3,5,2,3,1,1,6,2,3,3,3,3,3,3,1,3,3,3,3,2,3,3]
             _3                - subtract three = [15,-4,-1,-3,1,0,-1,1,-1,1,0,-1,0,0,1,-1,0,2,0,0,-3,0,1,-1,1,1,-2,1,0,1,0,-1,-2,2,0,2,-2,2,-3,0,0,0,0,0,0,0,1,0,1,-1,0,-1,1,2,1,-3,-2,0,-1,1,-1,2,1,-1,-1,1,-1,0,1,1,0,0,0,-1,0,0,0,0,1,1,0,0,-1,-3,2,0,2,-1,0,-2,-2,3,-1,0,0,0,0,0,0,-2,0,0,0,0,-1,0,0]
                \              - cumulative reduce with:
               +               -   addition    = [15,11,10,7,8,8,7,8,7,8,8,7,7,7,8,7,7,9,9,9,6,6,7,6,7,8,6,7,7,8,8,7,5,7,7,9,7,9,6,6,6,6,6,6,6,6,7,7,8,7,7,6,7,9,10,7,5,5,4,5,4,6,7,6,5,6,5,5,6,7,7,7,7,6,6,6,6,6,7,8,8,8,7,4,6,6,8,7,7,5,3,6,5,5,5,5,5,5,5,3,3,3,3,3,2,2,2]
                               -                 ("B" significant figures, with 1 extra for the very first entry and a missing last entry)
                 ⁺             - repeat (the cumulative addition to get
                               -         partition positions) = [15,26,36,43,51,59,66,74,81,89,97,104,111,118,126,133,140,149,158,167,173,179,186,192,199,207,213,220,227,235,243,250,255,262,269,278,285,294,300,306,312,318,324,330,336,342,349,356,364,371,378,384,391,400,410,417,422,427,431,436,440,446,453,459,464,470,475,480,486,493,500,507,514,520,526,532,538,544,551,559,567,575,582,586,592,598,606,613,620,625,628,634,639,644,649,654,659,664,669,672,675,678,681,684,686,688,690]
                  Ṭ            - untruth (1s at those indices) = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,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0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,1]
                           ¤   - nilad followed by link(s) as a nilad:
                     “...’     -   base 250 literal = 1359843400513624587387936539171476193226998298019011260296145341313618054174228221564540513907677646235598576881516831048668610360011296763157596112434066354611315520656149682812674618767665174340187902467878810176398777726380939419905999301878994359788697523921181381139996049417712856948672062172666339067588570924371193873605074589083368675762348993822578635527343917860838990096610451261212984313893905548521166455769553865473552505582564371567038561498058638593905602156107761843162541595425871682506975495717864037833528438238967028958839225553104375046108287174166796728551684149317511074854072740952784245380226630675896194056265560258597385991461978628176367665065866549060168787776
                          D    -   decimal (to base 10) = [1,3,5,9,8,4,3,4,0,0,5,1,3,6,2,4,5,8,7,3,8,7,9,3,6,5,3,9,1,7,1,4,7,6,1,9,3,2,2,6,9,9,8,2,9,8,0,1,9,0,1,1,2,6,0,2,9,6,1,4,5,3,4,1,3,1,3,6,1,8,0,5,4,1,7,4,2,2,8,2,2,1,5,6,4,5,4,0,5,1,3,9,0,7,6,7,7,6,4,6,2,3,5,5,9,8,5,7,6,8,8,1,5,1,6,8,3,1,0,4,8,6,6,8,6,1,0,3,6,0,0,1,1,2,9,6,7,6,3,1,5,7,5,9,6,1,1,2,4,3,4,0,6,6,3,5,4,6,1,1,3,1,5,5,2,0,6,5,6,1,4,9,6,8,2,8,1,2,6,7,4,6,1,8,7,6,7,6,6,5,1,7,4,3,4,0,1,8,7,9,0,2,4,6,7,8,7,8,8,1,0,1,7,6,3,9,8,7,7,7,7,2,6,3,8,0,9,3,9,4,1,9,9,0,5,9,9,9,3,0,1,8,7,8,9,9,4,3,5,9,7,8,8,6,9,7,5,2,3,9,2,1,1,8,1,3,8,1,1,3,9,9,9,6,0,4,9,4,1,7,7,1,2,8,5,6,9,4,8,6,7,2,0,6,2,1,7,2,6,6,6,3,3,9,0,6,7,5,8,8,5,7,0,9,2,4,3,7,1,1,9,3,8,7,3,6,0,5,0,7,4,5,8,9,0,8,3,3,6,8,6,7,5,7,6,2,3,4,8,9,9,3,8,2,2,5,7,8,6,3,5,5,2,7,3,4,3,9,1,7,8,6,0,8,3,8,9,9,0,0,9,6,6,1,0,4,5,1,2,6,1,2,1,2,9,8,4,3,1,3,8,9,3,9,0,5,5,4,8,5,2,1,1,6,6,4,5,5,7,6,9,5,5,3,8,6,5,4,7,3,5,5,2,5,0,5,5,8,2,5,6,4,3,7,1,5,6,7,0,3,8,5,6,1,4,9,8,0,5,8,6,3,8,5,9,3,9,0,5,6,0,2,1,5,6,1,0,7,7,6,1,8,4,3,1,6,2,5,4,1,5,9,5,4,2,5,8,7,1,6,8,2,5,0,6,9,7,5,4,9,5,7,1,7,8,6,4,0,3,7,8,3,3,5,2,8,4,3,8,2,3,8,9,6,7,0,2,8,9,5,8,8,3,9,2,2,5,5,5,3,1,0,4,3,7,5,0,4,6,1,0,8,2,8,7,1,7,4,1,6,6,7,9,6,7,2,8,5,5,1,6,8,4,1,4,9,3,1,7,5,1,1,0,7,4,8,5,4,0,7,2,7,4,0,9,5,2,7,8,4,2,4,5,3,8,0,2,2,6,6,3,0,6,7,5,8,9,6,1,9,4,0,5,6,2,6,5,5,6,0,2,5,8,5,9,7,3,8,5,9,9,1,4,6,1,9,7,8,6,2,8,1,7,6,3,6,7,6,6,5,0,6,5,8,6,6,5,4,9,0,6,0,1,6,8,7,8,7,7,7,6]
                               -                          ("A" all the required digits in order)
                   œṗ          - partition at truthy indices = [[1,3,5,9,8,4,3,4,0,0,5,1,3,6],[2,4,5,8,7,3,8,7,9,3,6],[5,3,9,1,7,1,4,7,6,1],[9,3,2,2,6,9,9],[8,2,9,8,0,1,9,0],[1,1,2,6,0,2,9,6],[1,4,5,3,4,1,3],[1,3,6,1,8,0,5,4],[1,7,4,2,2,8,2],[2,1,5,6,4,5,4,0],[5,1,3,9,0,7,6,7],[7,6,4,6,2,3,5],[5,9,8,5,7,6,8],[8,1,5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5,1],[1,0,7,4,8,5],[4,0,7,2,7,4,0,9],[5,2,7,8,4,2,4],[5,3,8,0,2,2,6],[6,3,0,6,7],[5,8,9],[6,1,9,4,0,5],[6,2,6,5,5],[6,0,2,5,8],[5,9,7,3,8],[5,9,9,1,4],[6,1,9,7,8],[6,2,8,1,7],[6,3,6,7,6],[6,5,0],[6,5,8],[6,6,5],[4,9,0],[6,0,1],[6,8],[7,8],[7,7],[7,6]]
                            Ç€ - call the last link (1) as a monad for €ach = [13.598434005136,24.587387936000002,5.391714761,9.322699,8.298019,11.260295999999999,14.534129999999998,13.618053999999999,17.422819999999998,21.56454,5.1390766999999995,7.646235,5.985767999999999,8.151683,10.486686,10.360009999999999,12.96763,15.759611200000002,4.34066354,6.1131552000000005,6.561490000000001,6.82812,6.746187,6.76651,7.434018,7.902467799999999,7.881010000000001,7.639876999999999,7.72638,9.394199,5.9993018,7.8994349999999995,9.7886,9.752392,11.81381,13.9996049,4.177128,5.6948672,6.2172600000000005,6.633900000000001,6.758850000000001,7.09243,7.1193800000000005,7.360500000000001,7.458900000000001,8.336860000000001,7.5762339999999995,8.993822,5.7863552,7.343916999999999,8.608388999999999,9.00966,10.45126,12.129843099999999,3.893905548,5.211664,5.5769,5.538600000000001,5.473,5.525,5.582,5.6437100000000004,5.670385,6.149800000000001,5.8638,5.939050000000001,6.0215000000000005,6.1077,6.184310000000001,6.254159,5.425871,6.825069,7.549570999999999,7.8640300000000005,7.833520000000001,8.43823,8.967020000000002,8.95883,9.225553,10.437504,6.1082871,7.416679599999999,7.285515999999999,8.414,9.31751,10.7485,4.072740899999999,5.278423999999999,5.3802259999999995,6.3067,5.89,6.194050000000001,6.2655,6.0258,5.973800000000001,5.9914000000000005,6.1978,6.281700000000001,6.3676,6.5,6.58,6.65,4.9,6.01,6.800000000000001,7.800000000000001,7.7,7.6000000000000005]

它们是1还是10 ”很容易:如果第一个数字是1或2,则它是10。这是否有助于进一步打高尔夫球,或者拆开位阵列的价格便宜吗?
彼得·泰勒,

@PeterTaylor没注意到,几乎可以肯定会节省一些字节,谢谢!
乔纳森·艾伦,

3

果冻,116 字节 + 429.796016684433 罚分 = 545.796016684433

“tẏØA5X¶tɱḅÐ-ı3OMm⁾¦ȷ #""*00-.Bı0FF_y¤ß÷!"&&)+5,=æ)8=Nc¡ÑÞŒŒŒÞßßñçðıȷñ÷Ø#,//6==@Nȷ*(6AR£ÑØøðñ÷ıııñ÷øþ !€ı#/-,‘+47÷12

在线尝试!

什么特别壮观,一个码页的索引列表,“...‘(0和249之间的数字),以其中的每一个我们添加47+47,然后通过除以12÷12


3

果冻,164字节+ 409.846 = 573.846

“?#4ß<Ʋƒ⁻µ`kḞÑ6{ɱ~.ṣ¬⁷Ḷlŀ⁸ẎṘ£ỌgfĖỌƒ⁻ḋN?ḤḞ{ị#qp⁵mp&WṘƙ=/rŻ-vn⁼ẊTị}W;!z€ȦMẊẇİ_D8ỴtṫQAẎḣṬr¥1J3Ƙ~ʋ$ĿẠ7þƭ8ṛM{ịḟƇỵ÷b?°6I@?Ȥ⁾d⁹DẈcȷv5ⱮAJb}øDȯRµ’Ds3Ḍ÷³×⁵$2R;6r⁵¤¤;15r18¤¤¦Y

在线尝试!

其中有一个压缩数字,是每个能量的前三个数字(包括尾随零)的串联。我得到这三个数字的列表,Ds3Ḍ然后用分别除以100 ÷³。一些数字只能除以10,因此我将其中一些乘以10可稍微提高分数(×⁵$2R;6r⁵¤¤;15r18¤¤¦)。

先前版本

果冻,50个字节+ 571.482罚款 = 621.482

“¡9;ẋkñ¬nƑḳ_gÐ.RḊụʠṁṬl⁾l>ɼXZĖSṠƈ;cḶ=ß³ṾAiʠʠɼZÞ⁹’DY

在线尝试!

将每个能量四舍五入到最接近的一位整数。串联在一起可以得到995989999958689999467777788889689999466777777889679999456656666666666657888899996778994556666666666677567888“¡9;ẋkñ¬nƑḳ_gÐ.RḊụʠṁṬl⁾l>ɼXZĖSṠƈ;cḶ=ß³ṾAiʠʠɼZÞ⁹’是一个基数为250的数字。DY 用换行符将该数字的数字连接起来。



3

J,390字节+ 183.319 罚款 = 573.319

d=.'5@-103659=-/-02247,...../////1-/1135,-...////0/0-/0124+--------.--....-.///00012.//012,--.-...--......,..///'
f=.'[ZG@=:U]JX-`~/PD~kB+XrjlKzx_hG~ynkq~1e5_k)+DMAY~nB\ M,y5YUOTZ`c.v}"*29JrVvsK~~6K*I<I?j'';F>y3:"~~3<DRZaz!ppf\'
p=.'tj1;p#Iq<M{^Z1c l~''@/q^aH9*~`J}~v8F~gQiGy8~%ye^F`Gt~-~G1ev>R4E$~F{/mKJ[S~HCrfxXkscWHku;t"c IWZF.n1l',9$' '
echo,.(_40+a.i.d)+(100%~_32+a.i.f)+1e4%~_32+a.i.p

在线尝试!

我将数字四舍五入为四个十进制数字,并将它们分为一个整数部分列表,一个列表用于前2个小数位数,一个用于后2个小数位数。我用可打印的字符对每个数字进行编码。为了进行解码,我简单地从关联的字符列表中提取数字的手指和小数部分,然后将它们组合回浮点数。

J,602字节+ 0 罚分 = 602

q=.'qy7?JOZp@''T1}Ciz={3L/0rHp/r}`M{m^ZHZSy55MYPBaNcV+\?A%/{eyQxQPkDs8W''@m$\6wZsV%KjI''_9"o\XMCP+vU=S3''c3\IKD@ovEW''4LX2O=>n&dgNktY><Ru_TvNpArL?}Y642=}5Hb"yYsD19$<OP2<|Jo)!8S`^9N3w{Q]968P2VF`[(2HOa%XL*V|,[8PcL)}w8"*l%JNC{amnCNx\yH73(pmJGCDq?8@D$ww{X`t0[o.`$''RB&eXiP|_u#9WBFS%U:3|O.U+is5E$A[c{1MpJ@Dw&^rpM_N:M^:o&!HPX9?0i}{j?%2W20z>Q?AOw!fuTWC"Q{-Er'
f=:3 :0
a=.0$0 while.*#y do.l=.1+{.y
a=.a,<' '-.~":}.l{.y
y=.l}.y
end.a
)
echo;(('.',~":"0)&.>_40+a.i.'5@-103659=-/-02247,...../////1-/1135,-...////0/0-/0124+--------.--....-.///00012.//012,--.-...--......,..///'),.(f 12,10#.inv 94x#._32+a.i.q),.<CR

在线尝试!

这次我采用了一种稍微不同的方法。我将数字分为2个流-第一个流包含整数部分,这些整数部分仅用单个可打印字符进行编码。第二个流包含整个分数部分。我删除了数字之间的所有间隔,并在每个子字符串的前面添加了1-9的长度(我对第一个小数进行了调整,其长度为13个数字)。然后,我将此列表编码为以94为基数的数字,并将其显示为字符列表。

如果将动词改写为默认值,则可以节省大约20个字节。


2

泡泡糖,403 + 9.12 = 412.12

00000000: 1551 5116 c030 04fb 7718 af20 e2fe 17db  .QQ..0..w.. ....
00000010: f2d1 454d 4322 cae7 d8d5 ef4d 142c db87  ..EMC".....M.,..
00000020: 5bdc 2bd8 785d 6cf4 22ec bc32 7167 f43c  [.+.x]l."..2qg.<
00000030: be38 8bf0 c4cb 8345 fb54 4759 9423 f8a6  .8.....E.TGY.#..
00000040: 2dd6 3b93 6919 3ee8 691b 8fba b758 5b47  -.;.i.>.i....X[G
00000050: 236b 6cfc 380b 1a3d 26c0 b278 de04 0845  #kl.8..=&..x...E
00000060: 85f7 c222 fdb0 288b f19d 4344 5a7b f503  ..."..(...CDZ{..
00000070: 6ada e011 1533 69f0 41f4 fdc8 64e8 be8d  j....3i.A...d...
00000080: e02a 0026 6c5d 3a83 7f70 2f1b ab88 8ca7  .*.&l]:..p/.....
00000090: 5fa8 e36a b64d 1425 f73a ee0c aab9 eb1a  _..j.M.%.:......
000000a0: 3b5f 1282 c9ba 9401 8c62 58b4 b5c7 6e24  ;_.......bX...n$
000000b0: 6d1c d7c4 aa7f c626 7e44 d569 8a21 c7d6  m......&~D.i.!..
000000c0: df65 d78f 1157 b495 4ea5 7b28 77ab 4035  .e...W..N.{(w.@5
000000d0: 9d45 561b fdae 9869 e34b d44c ea45 6b31  .EV....i.K.L.Ek1
000000e0: 46c7 63f1 ecfc bd03 645a 4f24 645a a4f6  F.c.....dZO$dZ..
000000f0: 1a56 ceab 7b33 ade1 3202 681b d19f a088  .V..{3..2.h.....
00000100: 1f7a 4b97 1c7d 9952 d1b5 21dc 571c d9dc  .zK..}.R..!.W...
00000110: 2702 a204 a254 f665 08e2 ed0a d451 c2a7  '....T.e.....Q..
00000120: 6344 df39 5c65 98f3 7092 d537 2bc3 897e  cD.9\e..p..7+..~
00000130: 25ac 9a34 7a17 b324 17fb 5238 64d9 79e6  %..4z..$..R8d.y.
00000140: cc94 a475 edbc 3675 6372 45d2 01ec c9ae  ...u..6ucrE.....
00000150: e44c 403c d1da 5eec 841e 6d73 acfd 6d6e  .L@<..^...ms..mn
00000160: 3f8d 94cb 4e39 507c 995a 4f3d ac94 9da8  ?...N9P|.ZO=....
00000170: afa5 cb13 2378 3994 da2d 0a2e 5a35 b754  ....#x9..-..Z5.T
00000180: 0943 9a0b 2b92 d151 1a6a 77a6 9c96 abb3  .C..+..Q.jw.....
00000190: ffc1 07                                  ...

在线尝试!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.