混合pi和e做馅饼!


36

大家都知道pi的数学常数,即圆周长与其直径之比。

3.14159265358979323846264338327950288419716939937510...

你可能也知道Ë数学常数,自然对数的底数。

2.71828182845904523536028747135266249775724709369996...

但是...你知道吗?(对我而言)这是最重要的常量之一。它是pie交错的数字。

32.1741185298216852385485997094352233854366206248373...

作为十进制扩展:

3, 2, 1, 7, 4, 1, 1, 8, 5, 2, 9, 8, 2, 1, 6, 8, 5, 2...

这是OEIS序列A001355

关键字:nonn,base,dumb,easy

这是一个非常愚蠢的序列。

挑战

编写一个使用非负整数n并输出pie第n位数字的程序/函数

技术指标

  • 适用标准I / O规则
  • 标准的漏洞禁止
  • 您的解决方案必须在每个常数中至少包含50位数字,这意味着它应在该序列中至少包含100个术语(请尽量不要对:P进行硬编码)。
  • 2或3的输出不是小数点
  • 您的解决方案可以是0索引或1索引,但是请指定。
  • 挑战不是要找到所有语言中最短的方法,而是要找到每种语言中最短的方法
  • 除非另有说明,否则您的代码通常以UTF-8编码形式以字节计分
  • 允许使用内置函数来计算此序列,但鼓励使用不依赖内置函数的解决方案。
  • 鼓励甚至对“实用”语言进行解释。

测试用例

这些是0索引的。

Input   Output

1       2
2       1
11      8
14      6
21      4
24      9
31      5

有几种更好的格式:

1 2 11 14 21 24 31
1, 2, 11, 14, 21, 24, 31

2 3 12 15 22 25 32
2, 3, 12, 15, 22, 25, 32

8
根据OEIS的说法,关键字dumb只是意味着没有兴趣而没有特殊的属性。
Okx

1
@Downvoter也许是任何原因吗?
totallyhuman '17

23
有人可能会说结果不是pei,而是pie
Zaid

1
我没有做过否决票,但是可能是因为您没有在3/14上问过这个问题;)
txtechhelp

1
在下午1:59,@ txtechhelp?;)
WallyWest

Answers:


12

Mathematica,50个字节

1索引

(Riffle@@(#&@@RealDigits[#,10,5!]&/@{Pi,E}))[[#]]& 

您能解释一下这是如何工作的吗?
Stevoisiak

这简单。每个元素需要120(5!)个元素并对其进行
修饰

真好!我尝试通过避免来击败您的解决方案Riffle,但我的解决方案只剩下一个字节:RealDigits[If[OddQ@#,Pi,E],10,#][[1,Ceiling[#/2]]]
Mark

这似乎不起作用。它返回一个数字。
DavidC

@DavidC是!..“输出饼的第n位数字”就是这样!你为什么要投票?
J42161217

8

出租车,749字节

'3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919' is waiting at Writer's Depot.Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to The Underground.Go to Writer's Depot:n 1 l 1 l 2 l.Pickup a passenger going to Chop Suey.Go to Chop Suey:n 3 r 3 r.[a]Pickup a passenger going to Narrow Path Park.Go to The Underground:s 1 r 1 l.Switch to plan "b" if no one is waiting.Pickup a passenger going to The Underground.Go to Narrow Path Park:n 4 l.Go to Chop Suey:e 1 r 1 l 1 r.Switch to plan "a".[b]Go to Narrow Path Park:n 4 l.Pickup a passenger going to Post Office.Go to Post Office:e 1 r 4 r 1 l.

在线尝试!

尝试以出租车方式以编程方式计算pi或e将是一场噩梦,尽管我敢肯定它可以做到。因此,仅硬编码序列中的前100位数字短得多。感觉很便宜,但绝对是应付挑战的最短出租车代码。

它将序列硬编码为字符串,输入in n,然后n向下迭代并每次删除字符串中的第一个字符。当为时n=0,输出第一个字符。这是一个索引。

取消高尔夫/格式化:

'3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919' is waiting at Writer's Depot.
Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to The Underground.
Go to Writer's Depot: north 1st left 1st left 2nd left.
Pickup a passenger going to Chop Suey.
Go to Chop Suey: north 3rd right 3rd right.
[a]
Pickup a passenger going to Narrow Path Park.
Go to The Underground: south 1st right 1st left.
Switch to plan "b" if no one is waiting.
Pickup a passenger going to The Underground.
Go to Fueler Up: south.
Go to Narrow Path Park: north 4th left.
Go to Chop Suey: east 1st right 1st left 1st right.
Switch to plan "a".
[b]
Go to Narrow Path Park: north 4th left.
Pickup a passenger going to Post Office.
Go to Post Office: east 1st right 4th right 1st left.

8

Haskell中,154 147 146个字节,NO硬编码OR BUILTIN常数的USE

该解决方案使用无穷级数计算epi并将它们存储在任意精度的定点整数(Haskell的内置Integer类型及其Rational扩展名)中。

import Data.Ratio
s n=product[n,n-2..1]
r=[0..164]
f n=(show$round$(*10^50)$sum[[2*s(2*k)%(2^k*s(2*k+1)),1%product[1..k]]!!mod n 2|k<-r])!!div n 2

取消高尔夫:

import Data.Ratio

semifact :: Integer -> Integer
semifact n = product [n, n-2..1]

pi_term :: Integer -> Rational
pi_term i = semifact (2*i) % (2^i * semifact (2*i+1))

--requires 164 terms to achieve desired precision
pi_sum :: Rational
pi_sum = 2 * (sum $ map (pi_term) [0..164])

--requires 40 terms to achieve desired precision
e_sum :: Rational
e_sum = sum [1 % product [1..k] | k<-[0..40]]

-- 51 digits are required because the last one suffers from rounding errors 
fifty1Digits :: Rational -> String
fifty1Digits x = show $ round $ x * 10^50

pi51 = fifty1Digits pi_sum
e51  = fifty1Digits e_sum

-- select a string to draw from, and select a character from it
pie_digit n = ([pi51, e51] !! (n `mod` 2)) !! (n `div` 2)

0索引。输入0-99准确,输入100-101不准确,否则超出范围。

说明:

使用此无穷级数计算pi。使用经典逆阶乘级数计算e。从理论上讲,这些不是理想的公式,因为它们在字节数方面不是很简洁,但是它们是我发现的唯一可以迅速收敛到足以使准确性验证可行的公式(如果需要,其他总数为数十万)而不是数百万个术语)。在高尔夫球版本中,e的计算精度要比所需的精度高得多,以便最小化字节数。计算两个常量的位数要比避免舍入误差所需的位数略多(这是造成不正确值的尴尬尾巴的原因)。

将常数计算为任意精度整数比率(Rational),然后乘以10 ^ 50,以便在将该比率转换为(任意精度)整数(Integer)时,所有必要的数字保持不变。这也避免了避免在数字的字符串表示形式中使用小数点的问题,该功能也可以从中抽取字符。


6

Python 2,88字节

-4字节,这归功于@EriktheOutgolfer的基本转换思想。

lambda n:`int("SVBPXJDZK00YCG3W7CZRA378H4AM5553D52T52ZKAFJ17F4V1Q7PU7O4WV9ZXEKV",36)`[n]

在线尝试!

Python 2 + sympy,92个字节

0索引。感谢Rod提醒我切换到from sympy import*,我以前忘记了。

lambda n:sum([('3','2')]+zip(`N(pi,50)`,`N(E,50)`[:47]+'6996')[2:],())[n]
from sympy import*

在线尝试!

Python 2,114字节

老实说,我认为最短的解决方案是硬编码,因为Python没有有用的内置函数。

lambda n:"3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919"[n]

在线尝试!

Python 2,114字节

@totallyhuman的等效解决方案。

'3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919'.__getitem__

在线尝试!


在降低投票率之前,请花点时间搜索较短的解决方案。
Xcoder先生17年


@totallyhuman谢谢
Xcoder先生17年

8
您在其中编辑的等效解决方案实际上是等效代码,而不是等效字节数。:P
完全人类的,

1
@totallyhuman大声笑我看到了您的评论并理解了它,但我完全忘了修复,因为我在笑自己的错误。感谢您的编辑!
Xcoder先生17年

5

05AB1E,10个字节

žsтžtøJþsè

说明:

žs          Get the first input digits of pi
  тžt       Get 100 digits of e
     ø      Zip them together
      J     Join into a string
       þ    Remove non-digits
        sè  0-indexed index of input in the resulting list

0索引。

在线尝试!


1
05AB1Es ......太多:P
Xcoder先生17年

@ Mr.Xcoder好吧,05AB1E是内置了pi和e的语言...
Okx

@ Mr.Xcoder这就是内置的原因。
暴民埃里克(Erik the Outgolfer)'17年

@totallyhuman不,不是。
暴民埃里克(Erik the Outgolfer)'17年

@Dorian您的版本不起作用。您使用的是旧版本,但那时还žt不是无限列表,这就是Okx在程序中使用e的前100位数字的原因。将其更改为新版本的05AB1E(其中pi和e都是无限列表)在您当前的版本中仍然不起作用,因为该zip会创建对,而Join将连接这些对而不是所有对。9个字节仍然是可能的通过更换JS在然而新的版本,其中,S使得它的字符/数字的平面化列表
凯文Cruijssen

5

Python 3中83 80个字节

0索引。

lambda n:('%d'*51%(*b' )4bD4&6UcF^#!U+B>0%"WK\<>0^GO9~1c]$O;',))[n]

在线尝试!

其中有些不可打印的字符在浏览器中无法正常显示。

这是通过(32, 17, 41, 18, 52, ...)从硬编码字节串中的字符的ASCII码构建元组来实现的。元组将转换为字符串'3217411852...',从中我们选择合适的数字。


4

多种语言,108字节

n=>"3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919"[n]

适用于:

  • C#
  • 的JavaScript

我认为这是您在C#中可以做的最短的操作,因为找到pi第N个小数是252个字节。


JS多语种:-)
Arnauld

@Arnauld更新了:)
TheLethalCoder

7
这不是Java语言!您无法在Java中索引到非数组对象。
罗曼·格拉夫(RomanGräf)

1
从技术上讲这是可行的,但我不赞成,因为它a)竞争性不强,b)非常无聊和琐碎。
HyperNeutrino

2
@HyperNeutrino C#和JavaScript何时具有竞争力?也许无聊而琐碎,但是您希望我在C#中做一个500字节的答案很聪明吗?否,因为那与点1冲突。这是如此之短……
TheLethalCoder

4

Java 8,420 417 413 404(计算)和115 110(硬编码)字节

计算(420 417 413 404):

import java.math.*;n->{int i=1,x=99;BigDecimal e,f=e=BigDecimal.ONE;BigInteger p,a=p=BigInteger.TEN.pow(x).multiply(new BigInteger("2"));for(;i<x;e=e.add(e.ONE.divide(f,new MathContext(x,RoundingMode.HALF_UP))))f=f.multiply(new BigDecimal(i++));for(i=1;a.compareTo(a.ZERO)>0;p=p.add(a))a=a.multiply(new BigInteger(i+"")).divide(new BigInteger(2*i+++1+""));return n==1?50:((n%2<1?p:e)+"").charAt(n+1>>1);}

硬编码:(115个字节):

"3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919"::charAt

0索引

-9和-5字节归功于@Nevay

  • 您的解决方案必须在每个常数中至少包含50位数字,这意味着它应在该序列中至少包含100个术语(请尽量不要对:P进行硬编码)
  • 允许使用内置函数来计算此序列,但建议使用不依赖内置函数的解决方案

您已经要求了..;)

Java内置的Math.PIMath.E是double,其最大精度仅为16。因此,我们必须使用java.math.BigInteger和/或自己计算两个值java.math.BigDecimal
由于我之前已经在另一个挑战中计算过PI,因此我使用了相同的代码BigIntegerBigDecimal但是,使用欧拉数算法。
将所得的pe因此是:31415...2.718...

可能仅使用可以打高尔夫球BigDecimal,但是对于PI却给出了一些不正确的答案,所以我现在同时使用BigDecimalBigInteger

说明:

在这里尝试。
证明它可以输出所需100个项目的正确结果。

import java.math.*;           // Required import for BigDecimal and BigInteger
n->{                          // Method with integer as parameter and char as return-type
  int i=1,                    //  Start index-integer at 1
      x=99;                   //  Large integer we use three times
  BigDecimal e,               //  Euler's number
             f=e=BigDecimal.ONE;
                              //  Temp BigDecimal (both `e` and `f` start at 1)
  BigInteger p,               //  PI
             a=p=BigInteger.TEN.pow(x).multiply(new BigInteger("2"));
                              //  Temp BigInteger (both `p` and `a` start at 10^25000*2)
  for(;i<x;                   //  Loop (1) 99 times (the higher the better precision)
    e=e.add(                  //    After every iteration: Add the following to `e`:
     e.ONE.divide(f,new MathContext(x,RoundingMode.HALF_UP))))
                              //     1/`f` (RoundingMode is mandatory for BigDecimal divide)
    f=f.multiply(new BigDecimal(i++));
                              //   Multiple `f` with `i`
                              //  End of loop (1) (implicit / single-line body)
  for(i=1;                    //  Reset `i` back to 1
      a.compareTo(a.ZERO)>0;  //  Loop (2) as long as `a` is not 0
    p=p.add(a))               //    After every iteration, add `a` to `p`
    a=a.multiply(new BigInteger(i+""))
                              //   Multiply `a` with `i`
       .divide(new BigInteger(2*i+++1+""));
                              //   and divide that by `2*i+1`
                              //  End of loop (2) (implicit / single-line body)
  // We now have `p`=31415... and `e`=2.718...
  return n==1?                // If the input (`n`) is 1:
          50                  //  Return 2
         :                    // Else:
          ((n%2<1?            //  If `n` is divisible by 2:
             p                //   Use `p`
            :                 //  Else:
             e)               //   Use `e` instead
    +"")                      //  Convert integer to String:
        .charAt(n+1>>1);      //   `n+1` signed right shift 1 bit
}                             // End of method

不确定是否对您有帮助,但是我计算C的C#算法比Java版本短8个字节。
TheLethalCoder

不过要注意让它为这个问题改变正常工作(d+=2),以++dreturn p%10+1公正return p%10
TheLethalCoder

@TheLethalCoder随时为这个挑战提供C#答案。:)尽管您还必须计算欧拉数。无论如何,我的回答对lolz来说还是有点,因为无论如何对输出进行硬编码都会更短
。–

1
You've asked for it.. ;)嘿,我比较喜欢您的第一个。我得到的硬编码答案比我预期的要多...
totallyhuman

1
charAt(n+1>>1)通过使用方法引用,您可以在计算得出的答案中保存9个字节,在硬编码版本中保存5个字节"..."::charAt
Nevay

3

种子,6015字节

105 41100973201674650461227976639700390615120600528953176107701316721890649738810349651490948904154731057172335535600875054878204557287393379815378680878571406244365932330202793040308312687924242319799562985464135998860369933720376853281630432469462831217924775601393232895404104191613314969008627719099002734936685651970933027922574843126481552407811220371545812798263882325951724505132794956253992779856191832909434513683936955184871247159313261417328850445886987045814618325821125417040265540589403338721758954467831926977078444612065747526326682314711350486782090838673475876960125016098416460032667015813053483457246043486676622061645094043655351781242050448580132075920324099742699960838361839038297355120817832056960516761862493176616153258281345538652844974811030063414112136642097000574165433957710342430709643110444042577685157477268110199017600011209827070311299268347100419887111107237908884608557593677163764286026624394674781868689858494991328505977301270068505397030743037416430245399054325956185200430657008806539374392625804513081295070438243600044274289109395357299275275193717501822777898664715885427884193864182834402097958423697356485767670945673525604620701482288023981110598866625872386643941558021439168402392304238271452444124214301243311025121833097491087918320170873313832323794851508364788578530614246140801266858481189449278157296335592848066512127882306035576754122325822200069362884409931190620435627809384380203617488253034370361172908245852012086081807945576657014184275798330804532115103840313004678040210379846666674881048346897213048386522262581473085489039138251061251160730845385869281787222083186331344552658814775998639661361866503862291670619153718574270905089351133527806484519543645501497150560454761284099358123613642350160410944676702481576280832672884549762767667090615809061739499629798396737503512011645776394176807352443544839957773371384141101627375926404212619777658374366513665083032140398814384622434755543347503025479743718569310129255927244046638238401670388409731849963600790867434678993019370132638962549859363736476668247251402420832876258626149639101811361047924632565285870213656416957893835899254928237592711662454838295046528789720146967061486405916116778722736283489123195985053535189375957277052428901645131462087039117212488839670735246752589931585405440449333046667938628384693216121067951290025349082277568986632815062532963505690244579740140120806885104683071514922412748240497612209609661707922754236180441892543545377867355182682381812487973645406703590150722720330526173957597156314579144484166520730013480681064941752984345205140917291104888971742824066713606933406657345121342075268990055328274845008936364502884461548416337689565392911129757761902576946104722487260155373897552821908338346641549478063474748830482136404008215583192489320750526753663943267086203954602839906762640389978523894333743126288529975769945319614142422443068420170103245659109689433597701350198280212250954698442638475209618790055335813263132865176791663235801963797561493995544185124734214257034901773781134331460320221759556924556747571745834582344275416625351302153332814233497096345055392255809024712740720006219615340819493781244665414077298346378966540544979367367978334759985048507214749726072645238624803791884339024844989975370042133733339339038567691571361407296615851372112592532463329778465699812822089846474961581380707849259093905314170108054540333209088059730272087864344697983074458088984533095183089310714804468718319244214535941276969904638763288063417624586766891798378622613765728303031397998644194508610598078718347204813844240434145846888722334194516524032354042557957058092854659539699310565707914118281251563405735083553254856313838760124953245573676126601070861004186509621892263623745673900572829301771299438501543213489182375655869072568437776298051260531944785904157204006430131566234389896821642210616326951771496269255716808352415001187083781128619236455170025989777631182990311607133740812107138446626302353752098982590371714623080450836912706275397973009559314275978915463843159370230629290376520494894845680706499809017211545204670148071902560908658269183779180493590025891585269507219866461550160579656755846447951259951641828495549544791046179035585611272240116822105364823082512055639047431280117805724371019657801828634946412396263504315569042536942671358095826696817513115447079645898107923447321583282886740680340887700198072304400536529418546232473450984945589794448490331085275232352881571706521961358975744067916422124670374397682877259664913100427726059898474024964867713698696116581478101206003313106174761699804016604950094008714907179862448792216891309734208815522069346791369498202430302292199779590583788518283934542807403049256936179914953814019565550264909025345322516061595136601312434888871667940394250767164496543418483237896796108764367721411969986710930448108645039275082356457263454340220118278471652962484104099512207532103709146426640958406853240342441810465024550617909657901698718289260589269758398513490424434162831332785821428006396653475356712733072469052427934231406388810607688824035522285626563562286337967271308076321307276537761026788485320280603487776428017017298356181654076403306265118978333909378403193559129146468182910851996415072056976175613473847242292911071040966109905552914332596680497156169349277079292398091020434667210493868422848588893205157133171899819212153010393580099455957808703428739456223073813663954919146593698106305501988107196273527346690785289909397140611634970017071011599022429384594426022933102487171920965595473754661194965266230932928905708783854897164127767575976566931916632077914904360565095752466049885656187054491320449776951484812738806536727562344348761718424255018794271994537719709226236497935053971406685810778014002594041715040546776952342303797267458880802314841325359844565479173256964507237937290466116935912176054052746039378370966040054779443633371806403649852746347690237831260027483859907620684197542069045517397230169577918374265220969534695931904

种子相当于我的Befunge答案。就像我在上面提到的那样,此输出的Befunge程序在TIO上不起作用,因为TIO似乎具有80个字符的内部换行符。


怎么样?只是...怎么了?
NieDzejkob


3

Excel,113个字节

1索引

=MID("3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919",A1,1)

PI()最多只能精确到15位数字。相似EXP(1)

60个适用于输入的42字节解决方案<=30 (由于@ Adam,-18个字节)

=MID(IF(ISODD(A1),PI(),EXP(1)/10)/10,A1/2+3,1)

在你的第二个方法的基本概念,只能由具有内部的PI / E选择缩短为46个字节if(...)声明:=MID(IF(ISODD(b1),PI(),EXP(1)/10)/10,b1/2+3,1).Can't得到周围人的不精确性pi()exp(),虽然
亚当

2

05AB1E,13个字节

Éi<;žtë;žs}þθ

在线尝试!

与Magic的答案相似,但有所不同。

说明:

Éi<;žtë;žs}þθ Supports 9842 digits of e and 98411 digits of π
É             a % 2
 i    ë   }   if a==1
  <            a - 1
   ;           a / 2
    žt         e to a digits
              else
       ;       a / 2
        žs     π to a digits
           þ  keep chars in [0-9] in a
            θ a[-1]


2

Japt,55个字节

" ®v4bØUî6UcF^#ß&6$Îø%\"Wí;<>0^GO9G1c]$O;"cs gU

在线测试!包含一些不可打印的内容。

通过用字符串的字符代码替换字符串中的每个字符,然后在正确的索引处返回数字来工作。该字符串是由以下程序生成的:

r"..(?=[^0]0)|25[0-5]|2[0-4].|1..|.(?=[^0]0)|..|."_n d

在线测试!


2

种子,5852 5794

根据TehPers Befunge的答案。

1051130021648715907393149878290493079600376561988348664272369051219541158034251323778110172612675089859184605166991106040693833909592598132115295033728752738087105881243462563076466678196376225832661747114302365429787133716511111381612588140144307910362782924144996564529411691568302571546828919454271683233497896594149189544327214969302848984257909609092418942847813158570493297692245428646803536815345759334224247677074872671057296478697076157019699466324478990259351466108726578472175001474585821629778406880297836753303012207209976229264609834293181367664486642493394085473509253813676093779567738697465957519812706192139261472118908699638816640825554051850436762061721281771892466822470585742923158999350909054375916612667405594051622229969696110285582900916410099224974902720736021096981441362371398922887585642863359978062601767338412679956208026294953110185271056006145171920926497396179933553547647876354874445336583594285656870801545177578902705927733720249211636847884869491097054175976937629709200212494761217184873108852140655722895359613462156833646123152648220793295854627649452190956799160703532861477096009725706141202331131287901266622861560576869037209421378739125115765163010112273561384890274706972479335859548424507413589440122160717697618157336618754196528390529316634155057447126317467878320143220148685911507025731721669456692292309133633447284353130542004299981319048073637696567634889623949341630372505055435189663767044165063763216111834588696399179737702861529836947970901482712510136315042152110633215913241916694919566433112405210063414042670097562256073600916103886503591248191758835092924394147776204171675226850914902590401360360345796925181247981647089261884952039081268986586818659090505317955579671089885915745568661758883469031230794272571159213300281445730703294269295310767401339422952480777920786878410780792687195268799097885426801795242758273587841272731685278721369746727313447085996142152811199340656395207452343492937579702451111716453371016654791322834865918860033642314402995240481293652425792697358895577606699947511030416728684352022506710677976841690749387202992493347056114389784733211172448656007595582911222364847293116425714996343958156522448560363063094260073906846664112391722958505451464414025605603413323283807093107521955579711235903403153357003170132938512689946882757999117710160645821945148763813674548797981224375547254576063310479473749044201972863935442758458424285806147218666471747061869918574545072745631758049982372007444866300485095061433951914878373501952670216546435388818497342311417254246013304856715094953051481317438104933875171470343900106719705171102058673610594748846178562080370992488881764909402902065625464750558527389775735939044400858705229893243673486621988009838791971714603625037310885148140796813757120291067372196872928228321095156712054303101901959874384063672886495472796070113365603843687513322867176197917489855537726934095360491472497352567147140246395682503059404971449739625647398820598964158265302668783916501984956044969021302601920487717382879106303683795359905325347814473318519391344565458920270463279174784746656360314070464241666622240210385245184959282222666398870656274940629675453574246097799383361429014800618720780346294542185892116417842240524776835458087900018007896901140383243611793705883547791450682392261960643824271328189332116466519255567441515615925840284456154022304291978218634565379575148642711337622789721842048696443945213454162713556316912301346193615227854869318871089808249776555077834342492281888561676171087168150941237306007109521081900169693331625918138699682645157924632842546989812618292449480799580909720292280095095845962850721356554807680991288722147671740885576811339492549454926901594927338274410385863276725958781460924134466358260089533908525106740467122470973368676988277207568882122479840074670300214980511007665457235218290742394089204192282508491125777180151491866961638111244962953268398339686189772372983926068579350047402754803068232034594024872791141428095120311259087973136353149728638143035136784730999270266072749004567217555438270988124997549762230020689881669285499865374963053282530118570884108038975805335341098720577305266629567047445192403700472887794782423940658412176424370062158626834653405675401415679083822191617061925174149189203359499283160374801737260780407460559147326758994495549579747033361234471750470244513311080274649191860724511086222353696966556035904101416366866518427071604705222938635947781869520181137451408849640159586041113639598272540062185768190959707775362176381804238896341317485410279831458927597060094913931822437950489034755418876566165098609145551163170170060968550804192429683076682433548504113044161906874992120619724109268394986529182050977866104283639955069424323124118234270471868688405770066267298550544345355480568344482162465184049105391961294335245926910436280167548428908725073049063187423431751542064521517069452498182346407984197390998799924644160478679731476796691938148057603728267749331459031937823996495889234787060791079241854542581243078812931046333013380737766914161425371301455762684652883345176576166320850926855173197613536554369628772428747263956045786416295429184651985570482338242016559363725421100270243627030197439290918962948652873397874243832067459791837014394278403085907234616003231621600132126403225123227458214686006897240158060744989458215243787817148717936756981074208678765977744940577875579654698779849605118845010395906232293740180888137656291524050590071724242335942378834532707622396324405477279768052696927856056064019532570357101573277570040254706775462396160275876038886428146097798897998315086627358220951838049046100218938610753230860169099104474379950181692561834872540511195903774693113510283120187768500261160296892119883913289017641545057765550924909632887927659777449405778755796986987798496051188450103959062322937401808881376562915250505900717242423359423788345327076223963244054772797680526969278560560640640195325703571015732775700402547067754623961602758760864281600977988973983150866273582209908925曼生的人18022509502938925195019507892501795290295179529092517952909251795290925193829015520过得死了吗7659777449405778755796986987798496051188450103959062322937401808881376562915250505900717242423359423788345327076223963244054772797680526969278560560640640195325703571015732775700402547067754623961602758760864281600977988973983150866273582209908925曼生的人18022509502938925195019507892501795290295179529092517952909251795290925193829015520过得死了吗

不错的工作!我对你打高尔夫球的方式有点好奇。
TehPers

2

Malbolge Unshackled(20次旋转旋转变体),3,64E6字节

该答案的大小超过了可发布程序的最大大小(eh),因此该代码位于我的GitHub存储库中(注意:请勿使用CTRL + A和CTRL + C复制该代码,只需右键单击并单击“将目标元素另存为。 ..”)。

如何运行呢?

这可能是一个棘手的部分,因为幼稚的Haskell解释器将需要很长的时间才能执行此操作。TIO有不错的Malbogle Unshackled解释器,但可惜我无法使用它(限制)。

我能找到的最好的是固定的20-trit旋转宽度变体,该变体表现很好,可以立即进行计算(非常多)

为了使口译员更快一些,我从Matthias Lutter的Malbolge Unshackled口译员中删除了所有支票。

#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

const char* translation = "5z]&gqtyfr$(we4{WP)H-Zn,[%\\3dL+Q;>U!pJS72Fh"
        "OA1CB6v^=I_0/8|jsb9m<.TVac`uY*MK'X~xDl}REokN:#?G\"i@";

typedef struct Word {
    unsigned int area;
    unsigned int high;
    unsigned int low;
} Word;

void word2string(Word w, char* s, int min_length) {
    if (!s) return;
    if (min_length < 1) min_length = 1;
    if (min_length > 20) min_length = 20;
    s[0] = (w.area%3) + '0';
    s[1] = 't';
    char tmp[20];
    int i;
    for (i=0;i<10;i++) {
        tmp[19-i] = (w.low % 3) + '0';
        w.low /= 3;
    }
    for (i=0;i<10;i++) {
        tmp[9-i] = (w.high % 3) + '0';
        w.high /= 3;
    }
    i = 0;
    while (tmp[i] == s[0] && i < 20 - min_length) i++;
    int j = 2;
    while (i < 20) {
        s[j] = tmp[i];
        i++;
        j++;
    }
    s[j] = 0;
}

unsigned int crazy_low(unsigned int a, unsigned int d){
    unsigned int crz[] = {1,0,0,1,0,2,2,2,1};
    int position = 0;
    unsigned int output = 0;
    while (position < 10){
        unsigned int i = a%3;
        unsigned int j = d%3;
        unsigned int out = crz[i+3*j];
        unsigned int multiple = 1;
        int k;
        for (k=0;k<position;k++)
            multiple *= 3;
        output += multiple*out;
        a /= 3;
        d /= 3;
        position++;
    }
    return output;
}

Word zero() {
    Word result = {0, 0, 0};
    return result;
}

Word increment(Word d) {
    d.low++;
    if (d.low >= 59049) {
        d.low = 0;
        d.high++;
        if (d.high >= 59049) {
            fprintf(stderr,"error: overflow\n");
            exit(1);
        }
    }
    return d;
}

Word decrement(Word d) {
    if (d.low == 0) {
        d.low = 59048;
        d.high--;
    }else{
        d.low--;
    }
    return d;
}

Word crazy(Word a, Word d){
    Word output;
    unsigned int crz[] = {1,0,0,1,0,2,2,2,1};
    output.area = crz[a.area+3*d.area];
    output.high = crazy_low(a.high, d.high);
    output.low = crazy_low(a.low, d.low);
    return output;
}

Word rotate_r(Word d){
    unsigned int carry_h = d.high%3;
    unsigned int carry_l = d.low%3;
    d.high = 19683 * carry_l + d.high / 3;
    d.low = 19683 * carry_h + d.low / 3;
    return d;
}

// last_initialized: if set, use to fill newly generated memory with preinitial values...
Word* ptr_to(Word** mem[], Word d, unsigned int last_initialized) {
    if ((mem[d.area])[d.high]) {
        return &(((mem[d.area])[d.high])[d.low]);
    }
    (mem[d.area])[d.high] = (Word*)malloc(59049 * sizeof(Word));
    if (!(mem[d.area])[d.high]) {
        fprintf(stderr,"error: out of memory.\n");
        exit(1);
    }
    if (last_initialized) {
        Word repitition[6];
        repitition[(last_initialized-1) % 6] =
                ((mem[0])[(last_initialized-1) / 59049])
                    [(last_initialized-1) % 59049];
        repitition[(last_initialized) % 6] =
                ((mem[0])[last_initialized / 59049])
                    [last_initialized % 59049];
        unsigned int i;
        for (i=0;i<6;i++) {
            repitition[(last_initialized+1+i) % 6] =
                    crazy(repitition[(last_initialized+i) % 6],
                        repitition[(last_initialized-1+i) % 6]);
        }
        unsigned int offset = (59049*d.high) % 6;
        i = 0;
        while (1){
            ((mem[d.area])[d.high])[i] = repitition[(i+offset)%6];
            if (i == 59048) {
                break;
            }
            i++;
        }
    }
    return &(((mem[d.area])[d.high])[d.low]);
}

unsigned int get_instruction(Word** mem[], Word c,
        unsigned int last_initialized,
        int ignore_invalid) {
    Word* instr = ptr_to(mem, c, last_initialized);
    unsigned int instruction = instr->low;
    instruction = (instruction+c.low + 59049 * c.high
            + (c.area==1?52:(c.area==2?10:0)))%94;
    return instruction;
}

int main(int argc, char* argv[]) {
    Word** memory[3];
    int i,j;
    for (i=0; i<3; i++) {
        memory[i] = (Word**)malloc(59049 * sizeof(Word*));
        if (!memory) {
            fprintf(stderr,"not enough memory.\n");
            return 1;
        }
        for (j=0; j<59049; j++) {
            (memory[i])[j] = 0;
        }
    }
    Word a, c, d;
    unsigned int result;
    FILE* file;
    if (argc < 2) {
        // read program code from STDIN
        file = stdin;
    }else{
        file = fopen(argv[1],"rb");
    }
    if (file == NULL) {
        fprintf(stderr, "File not found: %s\n",argv[1]);
        return 1;
    }
    a = zero();
    c = zero();
    d = zero();
    result = 0;
    while (!feof(file)){
        unsigned int instr;
        Word* cell = ptr_to(memory, d, 0);
        (*cell) = zero();
        result = fread(&cell->low,1,1,file);
        if (result > 1)
            return 1;
        if (result == 0 || cell->low == 0x1a || cell->low == 0x04)
            break;
        instr = (cell->low + d.low + 59049*d.high)%94;
        if (cell->low == ' ' || cell->low == '\t' || cell->low == '\r'
                || cell->low == '\n');
        else if (cell->low >= 33 && cell->low < 127 &&
                (instr == 4 || instr == 5 || instr == 23 || instr == 39
                    || instr == 40 || instr == 62 || instr == 68
                    || instr == 81)) {
            d = increment(d);
        }
    }
    if (file != stdin) {
        fclose(file);
    }
    unsigned int last_initialized = 0;
    while (1){
        *ptr_to(memory, d, 0) = crazy(*ptr_to(memory, decrement(d), 0),
                *ptr_to(memory, decrement(decrement(d)), 0));
        last_initialized = d.low + 59049*d.high;
        if (d.low == 59048) {
            break;
        }
        d = increment(d);
    }
    d = zero();

    unsigned int step = 0;
    while (1) {
        unsigned int instruction = get_instruction(memory, c,
                last_initialized, 0);
        step++;
        switch (instruction){
            case 4:
                c = *ptr_to(memory,d,last_initialized);
                break;
            case 5:
                if (!a.area) {
                    printf("%c",(char)(a.low + 59049*a.high));
                }else if (a.area == 2 && a.low == 59047
                        && a.high == 59048) {
                    printf("\n");
                }
                break;
            case 23:
                a = zero();
                a.low = getchar();
                if (a.low == EOF) {
                    a.low = 59048;
                    a.high = 59048;
                    a.area = 2;
                }else if (a.low == '\n'){
                    a.low = 59047;
                    a.high = 59048;
                    a.area = 2;
                }
                break;
            case 39:
                a = (*ptr_to(memory,d,last_initialized)
                        = rotate_r(*ptr_to(memory,d,last_initialized)));
                break;
            case 40:
                d = *ptr_to(memory,d,last_initialized);
                break;
            case 62:
                a = (*ptr_to(memory,d,last_initialized)
                        = crazy(a, *ptr_to(memory,d,last_initialized)));
                break;
            case 81:
                return 0;
            case 68:
            default:
                break;
        }

        Word* mem_c = ptr_to(memory, c, last_initialized);
        mem_c->low = translation[mem_c->low - 33];

        c = increment(c);
        d = increment(d);
    }
    return 0;
}

看起来好像超过3646个字节
H.PWiz

@ H.PWiz忘记了E,对不起
Krzysztof Szewczyk

1

05AB1E,14个字节

žssžt‚øJ'.Ks<è

在线尝试!


这个答案是0索引的。

žs              # pi to N digits.
  sžt           # e to N digits.
     ‚øJ        # Interleave.
        '.K     # No decimal points.
           s<è  # 0-indexed digit from string.

我知道已经有其他三个05AB1E答案,所以这并不重要,但是您可以通过更改'.Kþ和删除来打3个字节<。(不知道为什么还要包含<,因为您声明答案是0索引。您当前的答案是1索引<。)
Kevin Cruijssen

嗯..你也可以去掉,,因为拉链做到这一点含蓄,但我看它比几乎完全一样,其他10个字节的答案..
凯文Cruijssen

1

Python 3 + SymPy,109字节

0索引 在线尝试!

from mpmath import*
mp.dps=51
print(''.join(['32']+[str(pi)[i]+str(e)[i]for i in range(2,51)])[int(input())])

用5个字节击败硬编码!!但是可能会更好。但是击败硬编码让我感觉很好:)


1

Pyth,35个字节

@.i`u+/*GHhyHyK^T99rJ^2T0Z`sm/K.!dJ

测试套件

由于Pyth没有内置的任意精度pi和e常量,因此我直接计算它们。

计算pi:

u+/*GHhyHyK^T99rJ^2T0

这将使用以下递归连续分数来计算pi 2 + 1/3*(2 + 2/5*(2 + 3/7*(2 + 4/9*(2 + ...))))。我从另一个PPCG答案中得到的。它在此处的公式23-25中得出。

我从内到外进行了计算,忽略了第1024位之后的所有项,因为后一项对数字的影响很小,并且我保持99位的精度以确保前50个正确。

计算e:

sm/K.!dJ

我将前1024个数字的倒数相加,得出99位精度。

然后,我将两个数字都转换为字符串,对其进行交织并进行索引。


1

MATLAB,93字节

n=input('');
e=num2str(exp(1));
p=num2str(pi);
c=[];
for i=1:length(p)
 c=[c p(i) e(i)];
end;
c(n)

一个简单的解释是,这首先将e和pi转换为字符串,然后经过for循环以连接数字。这里,c是饼图,p是pi,e是e。

为了可读性,我也将其分为几行,但是实际代码全部都以一行排列在最小的间距上。


欢迎光临本站!
DJMcMayhem

谢谢,我已经浏览了一段时间的Code Golf,最后决定自己尝试一下。
a13a22

这有一些问题,主要是似乎没有任何输入。您需要修改函数,以便给定整数,n它将产生nthPie序列的数字。您还可以通过将变量名减少为一个字符来减少字节数
Taylor Scott

抱歉,我固定了字节数的变量名。至于第n位数字,我应该只定义n = ?,还是应该接受用户输入?
a13a22

看起来您已经明白了,但是您应该提示用户输入信息,但是,没有必要在该提示上附加任何格式,因此您可以input('')代替input('n')
Taylor Scott

1

朱莉娅63字节

1索引

a(n)=replace(string(BigFloat(n%2>0?π:e)),'.',"")[ceil(Int,n/2)]

将pi或e转换为字符串,删除小数位,然后调用适当的数字。返回数字的字符表示形式。


1
欢迎来到PPCG!
马丁·恩德

1

C#+ BigDecimal377372字节

d=>{if(d%2<1){d/=2;int l=++d*10/3+2,j=0,i=0;long[]x=new long[l],r=new long[l];for(;j<l;)x[j++]=20;long c,n,e,p=0;for(;i<d;++i){for(j=0,c=0;j<l;c=x[j++]/e*n){n=l-j-1;e=n*2+1;r[j]=(x[j]+=c)%e;}p=x[--l]/10;r[l]=x[l++]%10;for(j=0;j<l;)x[j]=r[j++]*10;}return p%10;}else{CognitioConsulting.Numerics.BigDecimal r=1,n=1,i=1;for(;i<99;)r+=n/=i++;return(r+"").Remove(1,1)[d/2]-48;}}

感谢@Kevin Cruijssen,节省了5个字节。

由于没有外部库,因此没有TIO链接,不幸的是C#没有内置BigDecimal类,因此该外部类将必须这样做。可能仍有打高尔夫球的可能,但现在没有时间。

完整/格式化版本:

namespace System.Linq
{
    class P
    {
        static void Main()
        {
            Func<int, long> f = d =>
            {
                if (d % 2 < 1)
                {
                    d /= 2;

                    int l = ++d * 10 / 3 + 2, j = 0, i = 0;
                    long[] x = new long[l], r = new long[l];

                    for (; j < l;)
                        x[j++] = 20;

                    long c, n, e, p = 0;

                    for (; i < d; ++i)
                    {
                        for (j = 0, c = 0; j < l; c = x[j++] / e * n)
                        {
                            n = l - j - 1;
                            e = n * 2 + 1;
                            r[j] = (x[j] += c) % e;
                        }

                        p = x[--l] / 10;
                        r[l] = x[l++] % 10;

                        for (j = 0; j < l;)
                            x[j] = r[j++] * 10;
                    }

                    return p % 10;
                }
                else
                {
                    CognitioConsulting.Numerics.BigDecimal r = 1, n = 1, i = 1;

                    for (; i < 99;)
                        r += n /= i++;

                    return (r + "").Remove(1,1)[d/2] - 48;
                }
            };

            for (int i = 0; i < 100; ++i)
            {
                Console.Write(f(i));
            }
            Console.WriteLine();

            Console.ReadLine();
        }
    }
}

您可以x[j++]/ec=(x[j++]/e)*n-2 处删除括号;另外,我认为您可以+""在两个return语句中都删除它们,并返回一个int而不是字符串,然后-48在第二个return语句中添加以将char转换为int输出(-1字节)。
凯文·克鲁伊森

@KevinCruijssen都很好,谢谢!
TheLethalCoder

1

Python 2,82字节

lambda n:`7*ord('L?J$rg$"79n*i.71&<B@[>)!Y8l:.pUo4GZ9c0a%'[n/2])`[n%2+1]

在线尝试!

包含一些不可打印的ASCII字符。flornquake保存了两个字节。


例如,这对于n = 64,n = 65中断。lambda n:('%02d'%ord('...'[n/2]))[n%2]尽管可能还有更好的方法,但不确定最好的方法是解决此问题。
flornquake

@flornquake天哪,你是对的。我写的修复程序短了一个字节。想不到什么更好的了
Lynn

真好 根据您的想法,这甚至更短:TIO
flornquake

0

Neim,45个字节

(₃β𝐒𝕣{𝕀𝔼𝐍N𝐭hj\CΓℚ𝕘𝕎𝐓φᚺ𝐲K$mᚠ"2𝕎oξ:{rm(𝕊/𝕚ᛂ𝐗})𝕕

neim不是十进制数字

在线尝试!


0

Befunge,105位元组

3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919&0g,@

在TIO上不起作用,因为出于某种原因它似乎在内部以80个字符换行。您可以通过将每个数字放在新行上,并在第一行&0g,@之后加上使其在TIO上工作3


1
使用Befunge 98在TIO上工作正常:tio.run
##Hcg7DsJAEATRqzgiwtJO9

0

JavaScript(ES6)+ mathjs,78个字节

(n,m=math.create({number:"BigNumber"}))=>`${n%2?m.e:m.pi}`.match(/\d/g)[n/2|0]

零索引,最多可处理128个数字(最大输入为127)。

测试片段

let f=
(n,m=math.create({number:"BigNumber"}))=>`${n%2?m.e:m.pi}`.match(/\d/g)[n/2|0]
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.16.0/math.min.js"></script>
<input type=number min=0 value=0 oninput="O.innerHTML=this.value.length>0?f(+this.value):''"><pre id=O>3


0

MATLAB(带符号工具箱),89 82字节

通过使用符号工具箱,此答案无需硬编码pi和e的值即可提供输出。

有趣的是,此代码作为输入可以采用单个索引或索引数组,并且将同时为所提供的所有索引值提供输出值(例如,提供1:10将输出前10个值)。

a=char(vpa({'exp(1)';'pi'},51));
a(a=='.')=[];
n=input('');
a(9+fix(n/2)+56*mod(n,2))

(增加了新行以提高可读性,不需要执行,因此不包括在字节数中)

不幸的是,TIO使用的八度版本不支持该vpa功能的符号输入,因此无法在TIO链接中提供。

在MATLAB中,无法以与Octave相同的方式将函数索引到返回向量中,这意味着这是一个完整的程序,而不仅仅是匿名函数。程序将n在执行过程中要求输入-这是一个需要元素的索引值。在程序结束时,将隐式打印该值。

对于该程序,我们使用该vpa函数将piand exp(1)(e)的值提供到51个小数位。这样做象征性地允许理论上无限的精度。要扩展100个以上的元素,只需增加51代码中的值即可扩大范围。

包裹vpachar(即char(vpa(...)))是必要的函数的输出转换为字符串,而不是一个符号值。结果输出是字符串:

matrix([[2.71828182845904523536028747135266249775724709369996], [3.14159265358979323846264338327950288419716939937511]])

这包括e和pi到小数点后51位-足以允许我们输出100位数字(我们必须做一些比要求多的dp,以避免打印舍入的值)

为了索引这种混乱状态,我们至少需要除去小数点,以便两个数字字符串都是连续的。最初,我使用简单的正则表达式替换所有不是数字的东西。但是,我可以通过使用代码仅去除小数点来节省7个字节:

a(a=='.')=[];

结果字符串现在是:

matrix([[271828182845904523536028747135266249775724709369996], [314159265358979323846264338327950288419716939937511]])

它包含我们在连续索引中同时包含pi和e块的所有数字。

然后,我们可以使用以下公式转换提供的索引,以使奇数访问pi块,偶数访问e块:

9+fix(n/2)+56*mod(n,2)

访问上述字符串中的该索引(索引)将提供正确的输出。


0

公理,148字节

g(x,n)==floor(numeric(x)*10^n)::INT rem 10
f(n:NNI):NNI==(m:=digits((n+4)::PI);x:=n quo 2;if n rem 2=1 then r:=g(%e,x)else r:=g(%pi,x);digits(m);r)

基于0的数组。结果

(10) -> [f(i) for i in 0..20]
   (10)  [3,2,1,7,4,1,1,8,5,2,9,8,2,1,6,8,5,2,3,8,5]
                                            Type: List NonNegativeInteger
(11) -> f(100001)
   (11)  6
                                                    Type: PositiveInteger

0

Google表格,47字节

注意:由于存储在Excel和Google表格中的常量的长度,因此该解决方案只能精确到20位数字

匿名工作表函数,它从单元格获取输入A1并将Pie的该数字输出到调用单元格

=Mid(.1*If(IsOdd(A1),Pi(),.1*Exp(1)),3+A1/2,1

硬编码版本,112字节

此版本完全符合程序规范,但通常并不好玩。

匿名工作表函数,返回饼图的1索引列表中的第n个数字

=Mid("3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919",A1,1

除以10以移位小数点(而不是SUBSTITUTE)可以在第一个解决方案中节省几个字节。
Wernisch '17

0

BFASM,142字节

stk 0
组织0
txt“ 3217411852982168523854859970943522338543662062483734873123759256062284894717957712649730999336795919”
in_ r1
rcl r2,r1
出r2

将输入作为ASCII字符,以数字形式给出输出。


0

脑干,5971字节

我的其他bfasm答案的直接翻译。

+>+[<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>>>>>>>>>>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,>[-]<[<+>>>>>>>>>>+>>>>>+<<<<<<<<<<<<<<-]<[>+<-]>>>>>>>>>>>>>>>[[>>]+[<<]>>-]+[>>]<[<[<<]>+<<<<<<<<<<<<+>>>>>>>>>>>>>[>>]<-]<[<<]>[>[>>]<+<[<<]>-]>[>>]<<[-<<]><<<<<<<<<<<<.<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]<<<[-]>[-]>>]<<]

在线尝试!

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.