fork(1) download
  1. require "bigdecimal"
  2. x = BigDecimal("1", 1000)
  3. epsi = BigDecimal("1E-1000", 1000)
  4. half = BigDecimal("0.5", 1000)
  5. while (delta = (1 - 2 * x**2) * x * half).abs > epsi do x += delta end
  6. print (x * 2).to_s[2,1001]
Time limit exceeded #stdin #stdout 5s 8536KB
stdin
Standard input is empty
stdout
Standard output is empty