Sort by

recency

|

81 Discussions

|

  • + 0 comments
    lambda_A,lambda_B =map(float,input().split())
    
    E_X2_A = lambda_A + (lambda_A ** 2)
    e_cost_A = 160 + 40 * E_X2_A
    
    E_X2_B = lambda_B + (lambda_B ** 2)
    e_cost_B = 128 + 40 * E_X2_B
    
    print(round(e_cost_A,3))
    print(round(e_cost_B,3))
    
  • + 0 comments

    x=0.88 y=1.55 Ca=160+40*(x+x**2) Cb=128+40*(y+y**2) print(round(Ca,3)) print(round(Cb,3))

  • + 1 comment
    from math import exp,factorial
    
    def thnks_for_the_fish(machine, cost):
        return sum((exp(-machine) * machine**k) / factorial(k) * (cost + 40 * k**2) for k in range(20))
    
    A,B = map(float,input().split(" "))
    
    print(round(thnks_for_the_fish(A, 160), 3))
    print(round(thnks_for_the_fish(B, 128), 3))
    
  • + 0 comments

    In R could be:

    stdin <- file('stdin')
    open(stdin)
    
    line <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]])
    cat(format(round(160 + 40*(line[1]+line[1]^2),3), nsmall=3), fill=TRUE)
    cat(format(round(128 + 40*(line[2]+line[2]^2),3), nsmall=3), fill=TRUE)
    
  • + 1 comment
    X,Y=map(float,input().split())
    print(round(160+(40*(X+X**2)),3))
    print(round(128+(40*(Y+Y**2)),3))